UNPKG

464 BTypeScriptView Raw
1/**
2 * Observer function for {@link IWatch} implementations.
3 */
4export declare type Watch<T> = (id: string, oldState: T, newState: T) => void;
5/**
6 * Interface for types offering observers of internal value changes.
7 * Also see `@IWatch` decorator mixin.
8 */
9export interface IWatch<T> {
10 addWatch(id: string, fn: Watch<T>): boolean;
11 removeWatch(id: string): boolean;
12 notifyWatches(oldState: T, newState: T): void;
13}
14//# sourceMappingURL=watch.d.ts.map
\No newline at end of file