allow fragments in implicit effects for children (#29)

* fix fragments in effects

* add test case

* more descriptive test
This commit is contained in:
alicesaidhi 2024-08-20 13:40:29 +02:00 committed by GitHub
parent 72e5fbb6fe
commit b85419088c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 49 additions and 3 deletions

View file

@ -11,6 +11,7 @@ local graph = require(script.Parent.graph)
type Node<T> = graph.Node<T>
type Array<V> = { V }
type ArrayOrV<V> = {ArrayOrV<V>} | V
type Map<K, V> = { [K]: V }
local free_caches: {
@ -124,7 +125,7 @@ local function apply<T>(instance: T & Instance, properties: { [unknown]: unknown
end
elseif type(property) == "number" then
if type(value) == "function" then
bind.children(instance, value :: () -> Instance | Array<Instance>) -- bind children
bind.children(instance, value :: () -> ArrayOrV<Instance>) -- bind children
elseif type(value) == "table" then
if is_action(value) then
table.insert(actions[(value :: any).priority], (value :: any).callback :: () -> ()) -- add action to buffer