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

@ -21,14 +21,7 @@ local function atom<T>(state: T, options: AtomOptions<T>?): Atom<T>
if state ~= nextState and not (equals and equals(state, nextState)) then
state = nextState
if store.isBatching() then
store.batched[atom] = true
else
for listener in pairs(table.clone(store.listeners[atom])) do
listener()
end
end
store.notify(atom)
end
return state