• TState
• TUpdater extends AnyUpdater = (cb) => TState
optional onSubscribe: (listener, store) => () => void;
optional onSubscribe: (listener, store) => () => void;
Called when a listener subscribes to the store.
Listener
Store<TState, TUpdater>
Function
a function to unsubscribe the listener
void
optional onUpdate: () => void;
optional onUpdate: () => void;
Called after the state has been updated, used to derive other state.
void
optional updateFn: (previous) => (updater) => TState;
optional updateFn: (previous) => (updater) => TState;
Replace the default update function with a custom one.
TState
Function
TUpdater
TState
Your weekly dose of JavaScript news. Delivered every Monday to over 100,000 devs, for free.