mirror of
https://github.com/littensy/charm.git
synced 2026-10-21 11:44:08 +00:00
refactor!: rename derive, map
This commit is contained in:
parent
f2f7a16599
commit
b715b81fec
18 changed files with 163 additions and 133 deletions
|
|
@ -1,18 +1,18 @@
|
|||
local store = require(script.Parent.store)
|
||||
|
||||
local function effect(molecule: () -> nil): () -> ()
|
||||
local atoms = store.capture(molecule)
|
||||
local captured = store.capture(molecule)
|
||||
|
||||
local function listener()
|
||||
molecule()
|
||||
end
|
||||
|
||||
for atom in atoms do
|
||||
for atom in captured do
|
||||
store.listeners[atom][listener] = true
|
||||
end
|
||||
|
||||
return function()
|
||||
for atom in atoms do
|
||||
for atom in captured do
|
||||
store.listeners[atom][listener] = nil
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue