@ima/core
Version:
IMA.js framework for isomorphic javascript application
41 lines (40 loc) • 1.24 kB
JavaScript
/**
* An Observable is a class that manages event listeners and allows distributing
* events to the registered listeners. It maintains a history of events and supports
* persistent events that are not cleared during route changes.
*/ export class Observable {
/**
* Initializes the observable.
*
* @returns The instance of the Observable for chaining.
*/ init() {
return this;
}
/**
* Destroys the observable by clearing its internal state and removing all event listeners.
*
* @returns The instance of the Observable for chaining.
*/ destroy() {
return this;
}
/**
* Clears all persistent events, observers, and activity history from the observable.
*
* This method will remove all stored events, registered observers, and any recorded
* activity history, effectively resetting the observable to its initial state.
*
* @returns The instance of the Observable for chaining.
*/ clear() {
return this;
}
registerPersistenEvent(event) {
return this;
}
subscribe(event, observer, scope) {
return this;
}
unsubscribe(event, observer, scope) {
return this;
}
}
//# sourceMappingURL=Observable.js.map