@blabbing/signals
Version:
A reactive state management tool
29 lines (23 loc) • 612 B
TypeScript
import { nothing } from 'immer';
import { Producer } from 'immer';
import { Signal } from 'signal-polyfill';
declare interface Atom<Value> {
/**
* Staged value used during transactions.
* @private
*/
_s: Signal.State<Value>;
/**
* Committed value.
* @private
*/
_c: Signal.State<Value>;
}
export { nothing }
/**
* Immutably update the value of an atom using imperative syntax.
*
* NOTE: This requires `immer` to be installed.
*/
export declare const patch: <Value>(atom: Atom<Value>, recipe: Producer<Value>) => void;
export { }