refactor: code quality

This commit is contained in:
Richard 2024-04-20 18:48:09 -07:00
parent f0a7938703
commit 8ca299f671
16 changed files with 82 additions and 101 deletions

View file

@ -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)