Disposes of this event, preparing it to release from memory
Runs the subscriptions for the event
Subscribes a function to run when this event is emitted.
Event for listeners to subscribe to. Subscribes a function to run when this event is emitted.
Use like const unsubscriber = event(callback)
Unsubscriber function to run to stop calling the passed-in function when the event is emitted
Protected
assertCheck to make sure this emitter is not disposed. Throw if it is
Protected
disposeDisposes of this event, preparing it to release from memory. Added here so children can override emit and still call the base functionality.
Protected
emitFunction that runs the subscriptions for the event. Added here so children can override emit and still call the base functionality. See NetworkEventEmitter.emit for example
Runs only the subscriptions for the event that are on this process. Does not send over network
Event data to provide to subscribed callbacks
Networked version of EventEmitter - accepts subscriptions to an event and runs the subscription callbacks when the event is emitted. Events on NetworkEventEmitters can be emitted across processes. They are coordinated between processes by their type. Use eventEmitter.event(callback) to subscribe to the event. Use eventEmitter.emit(event) to run the subscriptions. Generally, this EventEmitter should be private, and its event should be public. That way, the emitter is not publicized, but anyone can subscribe to the event.
WARNING: Do not use this class directly outside of NetworkService, or it will not do what you expect. Use NetworkService.createNetworkEventEmitter.
WARNING: You cannot emit events with complex types on the network.