mirror of
https://github.com/littensy/charm.git
synced 2026-10-20 17:51:37 +00:00
feat: allow conditional dependencies (#4)
* feat: allow conditional dependencies * docs: remove conditional deps warnings * fix: allow nested captures * docs: add dev flag * fix: `try()` uses pcall if passed `finally()` * docs: interval is optional * docs: update readme * docs: add client/server tags
This commit is contained in:
parent
fbc86d22c6
commit
a90d131fed
14 changed files with 290 additions and 98 deletions
|
|
@ -15,8 +15,8 @@ local function atom<T>(state: T, options: AtomOptions<T>?): Atom<T>
|
|||
|
||||
local function atom(...)
|
||||
if select("#", ...) == 0 then
|
||||
if store.isCapturing() then
|
||||
store.captured[atom] = true
|
||||
for set in store.capturing do
|
||||
set[atom] = true
|
||||
end
|
||||
|
||||
return state
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue