abon
Version:
Flexible state management for React 🚀
10 lines (9 loc) • 461 B
TypeScript
import { AsyncChangeListener, UnsubscribeFn } from "./types";
export declare class NotifierAsync<T> extends Set<AsyncChangeListener<T>> {
subscribe(listener: AsyncChangeListener<T>): UnsubscribeFn;
unsubscribe(listener: AsyncChangeListener<T>): void;
notify(value: T): void | Promise<void>;
notify(value: T, ...otherArgs: any[]): void | Promise<void>;
static get<T>(abon: any): NotifierAsync<T>;
static define<T>(abon: T): T;
}