UNPKG

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) 706 B
function t(t){this._observers.splice(this._observers.indexOf(t),1)}function e(t){const e=s();return this.observe((function(){t.apply(this,arguments)&&e.fire.apply(e,arguments)})),e}function r(t){return e.call(this,(function(e){return t===e}))}const n={detach:t,filter:e,fire:function(){const t=this._observers;if(t){for(let e=0;e<t.length;e++)try{t[e].apply(this,arguments)}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 s(t){return t?function(t,e){for(const r in e)t[r]=e[r];return t}(t,n):Object.create(n)}export{s as default};