Repository navigation
@xstate/store@5.0.0-alpha.6
Pre-release
Pre-release
·
12 commits
to main
since this release
Minor Changes
-
73cff29: Add
createSourceAtomfor read-only external snapshots. Direct and derived subscribers share one listener, released when the last consumer leaves. Plain reads do not subscribe; reconnecting refreshes the snapshot. The source adapter can return a cleanup function or a{ unsubscribe() }subscription. Public atom subscriptions always return{ unsubscribe() }, matching existing XState subscriptions.Failed activation remains eligible for a later atom operation. Errors delivering an async atom result are exposed through its
errorstate.const isDark = createSourceAtom({ getSnapshot: () => media.matches, subscribe: (notify) => { media.addEventListener('change', notify); return () => media.removeEventListener('change', notify); } });