jecs/modules/Jabby/vide/mount.luau

14 lines
459 B
Text
Raw Normal View History

2026-02-18 00:29:34 +00:00
if not game then script = require "test/relative-string" end
local root = require(script.Parent.root)
local apply = require(script.Parent.apply)
local function mount<T>(component: () -> T, target: Instance?): () -> ()
return root(function()
local result = component()
if target then apply(target, { result }) end
end)
end
return mount :: (<T>(component: () -> T, target: Instance) -> () -> ()) & ((component: () -> ()) -> () -> ())