atriusmaps-node-sdk
Version:
This project provides an API to Atrius Personal Wayfinder maps within a Node environment. See the README.md for more information
2 lines (1 loc) • 663 B
JavaScript
function t(t){this._observers?.splice(this._observers.indexOf(t),1)}function e(t){const e=n();return this.observe(function(...r){t.apply(this,r)&&e.fire(...r)}),e}function r(t){return e.call(this,function(e){return t===e})}const s={detach:t,filter:e,fire:function(...t){const e=this._observers;if(e){for(let r=0;r<e.length;r++)try{e[r].apply(this,t)}catch(t){console.error(t)}return this}},observe:function(e){return this._observers||(this._observers=[]),this._observers.push(e),{detach:t.bind(this,e),ob:this}},on:function(t,e){return r.call(this,t).observe(e)}};function n(t){return t?(e=t,r=s,Object.assign(e,r)):Object.create(s);var e,r}export{n as default};