Press n or j to go to the next uncovered block, b, p or k for the previous block.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | /** * @typeparam T - data that will be passed to the function when notified */ export interface SubscriptionManager<T = unknown> { /** * * @param callback - function to call when notified. It can be passed some data * @returns unsubscribe callback. */ subscribe(callback: (data: T) => void): () => void; /** * Notify subscribers. * @param data - optionally pass data to the subscribers. */ notify(data?: T): void; /** * a hook that subscribes from the current subscription. * @param callback - callback */ useSubscribeEffect(callback: (data: T) => void): void; } |