Skip to content

Instantly share code, notes, and snippets.

View andrewiggins's full-sized avatar

Andre Wiggins andrewiggins

View GitHub Profile
@andrewiggins
andrewiggins / Preact Signals Suspense Bug.tsx
Last active November 4, 2025 18:26 — forked from CharlieCrisp/PReact Signals Suspense Bug
This is a bunch of test cases that can be added to `suspense.test.tsx` in https://github.com/preactjs/signals. Two of these tests fail, indicating that when suspenses are used, signals used in components are never unwatched.
it("should clean up signals after unmount with multiple suspense boundaries", async () => {
let watchedCallCount = 0;
let unwatchedCallCount = 0;
// Create a signal with watched/unwatched callbacks to track cleanup
const trackedSignal = signal(0, {
name: "trackedSignal",
watched: function () {
watchedCallCount++;
},