- Subscription<V>(initialSubscribers?): {
notify: ((data: V) => void);
reset: (() => void);
subscribe: ((subscriber: Subscriber<V>) => void);
unsubscribe: ((subscriber: Subscriber<V>) => Subscriber<V>[]);
} Parameters
- initialSubscribers: Subscriber<V>[] = []
Returns {
notify: ((data: V) => void);
reset: (() => void);
subscribe: ((subscriber: Subscriber<V>) => void);
unsubscribe: ((subscriber: Subscriber<V>) => Subscriber<V>[]);
}
notify: ((data: V) => void)
reset: (() => void)
subscribe: ((subscriber: Subscriber<V>) => void)
- (subscriber): void
Parameters
- subscriber: Subscriber<V>
Returns void
unsubscribe: ((subscriber: Subscriber<V>) => Subscriber<V>[])
- (subscriber): Subscriber<V>[]
Parameters
- subscriber: Subscriber<V>
Returns Subscriber<V>[]
Creates a Subscription object that allows subscribing, unsubscribing, notifying and resetting subscribers.
Example