Creates a Subscription object that allows subscribing, unsubscribing, notifying and resetting subscribers.
initialSubscribers is copied, so the array you pass is never mutated and
later changes to it have no effect. notify calls the subscribers
registered when it started, each once, even if one unsubscribes itself or
another during the call; subscribers added during the call wait for the
next notify.
Creates a Subscription object that allows subscribing, unsubscribing, notifying and resetting subscribers.
initialSubscribersis copied, so the array you pass is never mutated and later changes to it have no effect.notifycalls the subscribers registered when it started, each once, even if one unsubscribes itself or another during the call; subscribers added during the call wait for the nextnotify.Example