mirror of
https://github.com/littensy/charm.git
synced 2026-10-21 19:54:09 +00:00
refactor: code quality
This commit is contained in:
parent
f0a7938703
commit
8ca299f671
16 changed files with 82 additions and 101 deletions
|
|
@ -1,6 +1,6 @@
|
|||
local atom = require(script.Parent.Parent.atom)
|
||||
local batch = require(script.Parent.Parent.batch)
|
||||
local effect = require(script.Parent.Parent.effect)
|
||||
local store = require(script.Parent.Parent.store)
|
||||
local subscribe = require(script.Parent.Parent.subscribe)
|
||||
|
||||
return function()
|
||||
|
|
@ -10,7 +10,7 @@ return function()
|
|||
subscribe(source, function()
|
||||
value += 1
|
||||
end)
|
||||
batch(function()
|
||||
store.batch(function()
|
||||
source(2)
|
||||
source(3)
|
||||
source(4)
|
||||
|
|
@ -28,7 +28,7 @@ return function()
|
|||
b()
|
||||
end)
|
||||
value = 0 -- effect() will run once initially
|
||||
batch(function()
|
||||
store.batch(function()
|
||||
a(2)
|
||||
b(2)
|
||||
a(3)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue