UNPKG

proxy-state-tree

Version:

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

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