You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
840 B
26 lines
840 B
declare type VoidFunc = () => void;
|
|
declare type Listener = {
|
|
callback: VoidFunc;
|
|
next: Listener | null;
|
|
prev: Listener | null;
|
|
};
|
|
declare function createListenerCollection(): {
|
|
clear(): void;
|
|
notify(): void;
|
|
get(): Listener[];
|
|
subscribe(callback: () => void): () => void;
|
|
};
|
|
declare type ListenerCollection = ReturnType<typeof createListenerCollection>;
|
|
export interface Subscription {
|
|
addNestedSub: (listener: VoidFunc) => VoidFunc;
|
|
notifyNestedSubs: VoidFunc;
|
|
handleChangeWrapper: VoidFunc;
|
|
isSubscribed: () => boolean;
|
|
onStateChange?: VoidFunc | null;
|
|
trySubscribe: VoidFunc;
|
|
tryUnsubscribe: VoidFunc;
|
|
getListeners: () => ListenerCollection;
|
|
}
|
|
export declare function createSubscription(store: any, parentSub?: Subscription): Subscription;
|
|
export {};
|