jecs/modules/Jabby/vide/action.luau

26 lines
466 B
Text
Raw Normal View History

2026-02-18 00:29:34 +00:00
type Action = {
priority: number,
callback: (Instance) -> ()
}
local ActionMT = table.freeze {}
local function is_action(v: any)
return getmetatable(v) == ActionMT
end
local function action(callback: (Instance) -> (), priority: number?): Action
local a = {
priority = priority or 1,
callback = callback
}
setmetatable(a :: any, ActionMT)
return table.freeze(a)
end
return function()
return action, is_action
end