@web-native-js/observer
Version:
A simple set of functions for intercepting and observing JavaScript objects and arrays.
34 lines (29 loc) • 548 B
JavaScript
/**
* ---------------------------
* The Fireable class
* ---------------------------
*/
export default class {
/**
* Initializes the instance.
*
* @param object|array subject
* @param object dfn
*
* @return void
*/
constructor(subject, dfn) {
this.subject = subject;
this.handler = dfn.handler;
this.filter = dfn.filter;
this.params = dfn.params;
}
/**
* Sets a "disconnected" flag on the Fireable.
*
* @return void
*/
disconnect() {
this.disconnected = true;
}
};