mirror of
https://github.com/centau/vide.git
synced 2026-08-20 14:41:37 +00:00
Initial commit
This commit is contained in:
commit
cb002f4f27
50 changed files with 4666 additions and 0 deletions
25
src/action.luau
Normal file
25
src/action.luau
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
type Action = {
|
||||
priority: number,
|
||||
callback: (Instance) -> ()
|
||||
}
|
||||
|
||||
local ActionMT = {}
|
||||
|
||||
local function is_action(v: any)
|
||||
return getmetatable(v) == ActionMT
|
||||
end
|
||||
|
||||
local function action(callback: (Instance) -> (), priority: number?): Action
|
||||
local t = {
|
||||
priority = priority or 1,
|
||||
callback = callback
|
||||
}
|
||||
|
||||
setmetatable(t :: any, ActionMT)
|
||||
|
||||
return t
|
||||
end
|
||||
|
||||
return function()
|
||||
return action, is_action
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue