emit()
Emits an event, immediately calling all event handlers.
emit(event?: ObservableEvent): this;
emit(event: string, data?: Record<string, any>): this;
Notes
- Events can be handled using ObservableObject.listen() or ObservableObject.attach().
- If the first argument is undefined, no event is emitted at all and this method returns quietly.
Parameters
- event — An instance of ObservableEvent, or an event name; if a name is provided, an instance of ObservableEvent will be created by this method
- data — Additional data to be set on ObservableEvent.data, if
eventis a string; the object is treated as immutable and may be reused between events.
Related
class ObservableObject
The base class of all observable objects, which can be placed into a tree structure to enable event handling and data binding.
