mirror of
https://github.com/littensy/charm.git
synced 2026-10-22 04:14:08 +00:00
feat: add signal api
This commit is contained in:
parent
bf92413a97
commit
1e0b10aef6
21 changed files with 300 additions and 293 deletions
|
|
@ -10,6 +10,7 @@ local function useAtom<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))
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue