EVENT_MANAGER:RegisterForEvent(BarTracker.name, EVENT_ACTION_LAYER_PUSHED, function() BarTracker.toggleVisibility(true) end)
It's basically shorthand for something like below. The only difference is that in the code below, the function has the name TurnOffVisibility, while in the code above, the function is anonymous.
Lua Code:
local function TurnOffVisibility()
BarTracker.toggleVisibility(true)
end
EVENT_MANAGER:RegisterForEvent(BarTracker.name, EVENT_ACTION_LAYER_PUSHED, TurnOffVisibility)
I suppose "function() BarTracker.toggleVisibility(true) end" might be the same as your JavaScript example? Is "(() => BarTracker.toggleVisibility(true))" a function?