UNPKG

@rcsb/rcsb-saguaro-3d

Version:
34 lines (33 loc) 1.05 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.RcsbFvContextManager = 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 RcsbFvContextManager { 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.RcsbFvContextManager = RcsbFvContextManager;