Skip to content

mintmousse.has

Use this function to check if a component exists locally already. Useful if you want to use mintmousse.get, but not accidentally create a new component.

Synopsis

doesExist = mintmousse.has( id )

Parameters

id string
The ID of the component you're trying to check if it exists locally.

Returns

doesExist boolean
If the given ID already has a component table on the current thread.

Examples

if mintmousse.has("dashboardTab") then
  local dashboard = mintmousse.get("dashboardTab")
end

if not mintmousse.has("foobar") then
  mintmousse.get("foobar", "Accordion")
end

See Also