Skip to content

Clear the snapshot cache of useComponentPins and useNodePins on store changes - #69

Merged
chelproc merged 1 commit into
mainfrom
fix-selector-snapshot-cache
Nov 1, 2026
Merged

chelproc merged 1 commit into
mainfrom
fix-selector-snapshot-cache

Conversation

@chelproc

@chelproc chelproc commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

useComponentPins and useNodePins memoize their snapshots with memoizeOne, but their store event handlers never cleared the cache. As a result, they kept returning the first result even after pins were registered, updated or unregistered.

The handlers now call getSnapshot.clear() before notifying React, in the same way as useComponents, useNodeIds and useConnectionIds.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

Deploying create-cpu-c8345196-9409-4cce-afc4-389f413ad8ee with  Cloudflare Pages  Cloudflare Pages

Latest commit: 25cba4e
Status: ✅  Deploy successful!
Preview URL: https://97506518.create-cpu-c8345196-9409-4cce-afc4-389f413ad8ee.pages.dev
Branch Preview URL: https://fix-selector-snapshot-cache.create-cpu-c8345196-9409-4cce-afc4-389f413ad8ee.pages.dev

View logs

@chelproc
chelproc merged commit 7112ea4 into main Nov 1, 2026
2 checks passed
@chelproc
chelproc deleted the fix-selector-snapshot-cache branch November 1, 2026 03:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant