Commit c798c94
committed
Fix deferred subscription replay for
The `[symDispose]()` method was clearing `_subscribers` after calling
`this.f()`. With the `using _ = useSignals()` pattern, `[symDispose]`
is invoked at the end of the component function scope — before React's
commit phase where the `useIsomorphicLayoutEffect` replays the deferred
subscriptions. This wiped the captured subscribers before they could be
replayed, so signals were never actually subscribed and updates were
silently lost.
In the managed (try/finally) path, `f()` is called instead of
`[symDispose]()`, and `f()` does not clear `_subscribers` — which is
why the transform path worked correctly.
Stale subscribers from suspended renders are already handled by the
`subscribe` cleanup (clears on unmount) and the layout effect's
`_version !== -1` check (filters out dropped dependencies).
Assisted-By: devx/7d7bbf25-b015-4660-ad92-7e391d7d8929using keyword1 parent 858ef53 commit c798c94
1 file changed
Lines changed: 0 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
333 | 333 | | |
334 | 334 | | |
335 | 335 | | |
336 | | - | |
337 | 336 | | |
338 | 337 | | |
339 | 338 | | |
| |||
0 commit comments