@rcsb/rcsb-saguaro-3d
Version:
RCSB Molstar/Saguaro Web App
34 lines (33 loc) • 1.07 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.RcsbFvCustomContextManager = exports.EventType = void 0;
const rxjs_1 = require("rxjs");
/**Event types*/
var EventType;
(function (EventType) {
EventType["UPDATE_CONFIG"] = "updateBoardConfig";
EventType["PLUGIN_CALL"] = "pluginCall";
})(EventType || (exports.EventType = EventType = {}));
/**rxjs Event Handler Object. It allows objects to subscribe methods and then, get(send) events to(from) other objects*/
class RcsbFvCustomContextManager {
constructor() {
this.subject = new rxjs_1.Subject();
}
/**Call other subscribed methods
* @param obj Event Data Structure Interface
* */
next(obj) {
this.subject.next(obj);
}
/**Subscribe loadMethod
* @return Subscription
* */
subscribe(f) {
return this.subject.asObservable().subscribe(f);
}
/**Unsubscribe all methods*/
unsubscribeAll() {
this.subject.unsubscribe();
}
}
exports.RcsbFvCustomContextManager = RcsbFvCustomContextManager;