refactor: improve imports

This commit is contained in:
littensy 2025-05-05 01:30:35 -07:00
parent 209f9b583b
commit 8df67d6fff
20 changed files with 67 additions and 86 deletions

View file

@ -1,7 +1,5 @@
local Charm = require(script.Parent.Charm)
local Vide = if script.Parent:FindFirstChild("vide")
then require((script :: any).Parent.vide.src) :: never
else require(script.Parent.Vide)
local Vide = require(script.Parent.Vide)
local subscribe = Charm.subscribe
local source = Vide.source
@ -15,8 +13,7 @@ local cleanup = Vide.cleanup
]=]
local function useAtom<State>(callback: () -> State): () -> State
local state = source(callback())
local dispose = subscribe(callback, state)
cleanup(dispose)
cleanup(subscribe(callback, state))
return state
end