mirror of
https://github.com/centau/vide.git
synced 2026-08-20 14:41:37 +00:00
Fix actions receiving nil instance
Action callbacks were being called with 'nil' instead of an instance. This commit fixes the action buffer type and passes 'instance' to the action callback.
This commit is contained in:
parent
4dc12e0157
commit
f111105c5f
1 changed files with 2 additions and 2 deletions
|
|
@ -14,7 +14,7 @@ type Node<T> = graph.Node<T>
|
||||||
local event_buffer: { [string]: () -> () } = {}
|
local event_buffer: { [string]: () -> () } = {}
|
||||||
|
|
||||||
-- buffer of priority -> callback to run after events are connected
|
-- buffer of priority -> callback to run after events are connected
|
||||||
local action_buffers = {} :: { { () -> () } }
|
local action_buffers = {} :: { { (Instance) -> () } }
|
||||||
setmetatable(action_buffers :: any, {
|
setmetatable(action_buffers :: any, {
|
||||||
__index = function(_, i: number)
|
__index = function(_, i: number)
|
||||||
action_buffers[i] = {}
|
action_buffers[i] = {}
|
||||||
|
|
@ -131,7 +131,7 @@ local function apply<T>(instance: T & Instance, properties: { [unknown]: unknown
|
||||||
-- run buffered actions respecting their priorities
|
-- run buffered actions respecting their priorities
|
||||||
for _, buffer in next, action_buffers do
|
for _, buffer in next, action_buffers do
|
||||||
for _, callback in next, buffer do
|
for _, callback in next, buffer do
|
||||||
callback()
|
callback(instance)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue