feat!: run listen and subscribe callback in untracked

This commit is contained in:
littensy 2026-03-19 18:42:30 -07:00
parent 50afcaf6e9
commit 5c27052965
11 changed files with 28 additions and 156 deletions

View file

@ -11,10 +11,7 @@ local Vide = require("./Vide")
local function useSignalState<State>(getter: () -> State): () -> State
local state = Vide.source(getter())
Vide.cleanup(Charm.effect(function()
-- Wrap in untracked to avoid tracking inner effect and atom calls
Charm.untracked(state :: (State) -> State, getter())
end))
Vide.cleanup(Charm.listen(getter, state))
return state
end