Repository navigation
Commit 5b43704
committed
fix: release form handle when set(IDLE) finds no subscribers
When a component unmounts during an in-flight submit, the subscribe
cleanup skips release() because state !== IDLE. When the write later
resolves and set(IDLE) runs, there are no subscribers left but set()
never called release(), leaving the handle in the store's forms map
for the rest of the session.
Add a release check in set() so an idle handle with zero subscribers
is collected regardless of whether the last subscriber left before or
after the state returned to IDLE.1 parent 35c8cb2 commit 5b43704
1 file changed
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
152 | 152 | | |
153 | 153 | | |
154 | 154 | | |
| 155 | + | |
155 | 156 | | |
156 | 157 | | |
157 | 158 | | |
| |||
0 commit comments