@blabbing/signals
Version:
A reactive state management tool
35 lines (28 loc) • 684 B
TypeScript
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>;
}
declare interface Computed<Value> {
/**
* Staged value used during transactions.
*/
_s: Signal.Computed<Value>;
/**
* Committed value.
*/
_c: Signal.Computed<Value>;
}
/**
* Get the value of an atom or computed and subscribe to changes.
*/
export declare const useValue: <Value>(store: Atom<Value> | Computed<Value>) => Value;
export { }