UNPKG

proxy-state-tree

Version:

An implementation of the Mobx/Vue state tracking approach, for library authors

17 lines (16 loc) 669 B
import { IProxifier, IProxyStateTree, ITrackCallback, ITrackScopedCallback, ITrackStateTree } from './types'; export declare class TrackStateTree<T extends object, D> implements ITrackStateTree<T, D> { root: IProxyStateTree<T, D>; pathDependencies: Set<string>; state: T; proxifier: IProxifier<T>; trackPathListeners: Array<(path: string) => void>; constructor(root: IProxyStateTree<T, D>); trackPaths(): () => Set<string>; track(): this; canMutate(): boolean; canTrack(): boolean; addTrackingPath(path: string): void; subscribe(cb: ITrackCallback): () => void; trackScope(scope: ITrackScopedCallback<T, D>): this; }