feat(react): add useWrnStore bridge over useSyncExternalStore

Resolves WRNexus stores from inside islands, reading through the cached
snapshot so React sees a stable reference. Unknown store names throw
with the list of registered stores rather than failing opaquely.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-18 15:12:33 +05:30
co-authored by Claude Opus 5
parent 468f63f378
commit ce67d0d1d2
5 changed files with 333 additions and 740 deletions
+4
View File
@@ -0,0 +1,4 @@
export { createSelectorCache, createSnapshotCache } from "./snapshot-cache.ts";
export type { SnapshotCache, SnapshotSource } from "./snapshot-cache.ts";
export { setStoreResolver, useWrnActions, useWrnStore } from "./store-bridge.ts";
export type { BoundStore, IslandStore, StoreResolver } from "./store-bridge.ts";