mirror of
https://github.com/littensy/charm.git
synced 2026-10-21 03:36:11 +00:00
fix: skip nested captures (#22)
* fix: skip nested captures * test: update atom bench
This commit is contained in:
parent
69e5f78463
commit
7c323e5739
5 changed files with 71 additions and 44 deletions
|
|
@ -15,8 +15,10 @@ local function atom<T>(state: T, options: AtomOptions<T>?): Atom<T>
|
|||
|
||||
local function atom(...)
|
||||
if select("#", ...) == 0 then
|
||||
for set in next, store.capturing do
|
||||
set[atom] = true
|
||||
local index = store.capturing.index
|
||||
|
||||
if index > 0 then
|
||||
store.capturing.stack[index][atom] = true
|
||||
end
|
||||
|
||||
return state
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue