-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathLayerStore.js.map
1 lines (1 loc) · 6.56 KB
/
LayerStore.js.map
1
{"version":3,"sources":["../src/LayerStore.js"],"names":["LayerStore","_core","LayerStoreCore","_layerSubscriptions","_mountPointsubscriptions","show","bind","hide","update","register","updateFn","unregister","getLayer","getStack","getIndex","isActive","getLayersForMountPoint","id","fn","Set","add","delete","forEach","layerFn","mountPointId","groups","use","defaultArgs","defaultShow","notifyMountPoint","notifyLayer","lastMountPoint","reset","args","stack"],"mappings":";;AAEA,kD;;AAEqBA,U;;AAEnB,wBAAe;AACb,SAAKC,KAAL,GAAa,IAAIC,wBAAJ,EAAb;AACA,SAAKC,mBAAL,GAA2B,EAA3B;AACA,SAAKC,wBAAL,GAAgC,EAAhC;;AAEA,SAAKC,IAAL,GAAY,KAAKA,IAAL,CAAUC,IAAV,CAAe,IAAf,CAAZ;AACA,SAAKC,IAAL,GAAY,KAAKA,IAAL,CAAUD,IAAV,CAAe,IAAf,CAAZ;AACA,SAAKE,MAAL,GAAc,KAAKA,MAAL,CAAYF,IAAZ,CAAiB,IAAjB,CAAd;AACA,SAAKG,QAAL,GAAgB,KAAKA,QAAL,CAAcH,IAAd,CAAmB,IAAnB,CAAhB;AACA,SAAKI,QAAL,GAAgB,KAAKA,QAAL,CAAcJ,IAAd,CAAmB,IAAnB,CAAhB;AACA,SAAKK,UAAL,GAAkB,KAAKA,UAAL,CAAgBL,IAAhB,CAAqB,IAArB,CAAlB;AACA,SAAKM,QAAL,GAAgB,KAAKX,KAAL,CAAWW,QAA3B;AACA,SAAKC,QAAL,GAAgB,KAAKZ,KAAL,CAAWY,QAA3B;AACA,SAAKC,QAAL,GAAgB,KAAKb,KAAL,CAAWa,QAA3B;AACA,SAAKC,QAAL,GAAgB,KAAKd,KAAL,CAAWc,QAA3B;AACA,SAAKC,sBAAL,GAA8B,KAAKf,KAAL,CAAWe,sBAAzC;AACD,G;;AAEgBC,M,EAAQC,E,EAAc;AACrC,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KAAL,CAAWM,IAAX,CAAgBU,EAAhB;AACA,WAAKa,WAAL,CAAiBb,EAAjB;AACD,K,6CAnGkBjB,U","file":"LayerStore.js","sourcesContent":["import type { ID, LayerFn } from './types'\r\n\r\nimport LayerStoreCore from './LayerStoreCore'\r\n\r\nexport default class LayerStore {\r\n\r\n constructor () {\r\n this._core = new LayerStoreCore;\r\n this._layerSubscriptions = {};\r\n this._mountPointsubscriptions = {};\r\n\r\n this.show = this.show.bind(this);\r\n this.hide = this.hide.bind(this);\r\n this.update = this.update.bind(this);\r\n this.register = this.register.bind(this);\r\n this.updateFn = this.updateFn.bind(this);\r\n this.unregister = this.unregister.bind(this);\r\n this.getLayer = this._core.getLayer;\r\n this.getStack = this._core.getStack;\r\n this.getIndex = this._core.getIndex;\r\n this.isActive = this._core.isActive;\r\n this.getLayersForMountPoint = this._core.getLayersForMountPoint;\r\n }\r\n\r\n subscribeToLayer(id: ID, fn: Function) {\r\n if (typeof this._layerSubscriptions[id] === 'undefined') {\r\n this._layerSubscriptions[id] = new Set();\r\n }\r\n this._layerSubscriptions[id].add(fn);\r\n return () => {\r\n return this._layerSubscriptions[id].delete(fn);\r\n }\r\n }\r\n\r\n subscribeToMountPoint(id: ID, fn: Function) {\r\n if (typeof this._mountPointsubscriptions[id] === 'undefined') {\r\n this._mountPointsubscriptions[id] = new Set();\r\n }\r\n this._mountPointsubscriptions[id].add(fn);\r\n return () => {\r\n return this._mountPointsubscriptions[id].delete(fn);\r\n }\r\n }\r\n\r\n notifyLayer(id: ID) {\r\n if (this._layerSubscriptions[id]) {\r\n this._layerSubscriptions[id].forEach(fn => fn())\r\n }\r\n }\r\n\r\n notifyMountPoint(id: ID) {\r\n if (this._mountPointsubscriptions[id]) {\r\n this._mountPointsubscriptions[id].forEach(fn => fn());\r\n }\r\n }\r\n\r\n register (id: ID, layerFn: LayerFn, mountPointId: ID = null,\r\n groups: Array<ID> = [], use: Array<any>, defaultArgs: Array<any> = [],\r\n defaultShow: Boolean) {\r\n this._core.register(id, layerFn, mountPointId, groups, use, defaultArgs, defaultShow);\r\n if (mountPointId) {\r\n this.notifyMountPoint(mountPointId);\r\n } else {\r\n this.notifyLayer(id);\r\n }\r\n }\r\n\r\n updateFn (id: ID, layerFn: LayerFn, mountPointId: ID = null,\r\n groups: Array<ID> = [], use: Array, defaultArgs: Array = [],\r\n defaultShow: Boolean) {\r\n const lastMountPoint = this.getLayer(id).mountPointId;\r\n this._core.updateFn(id, layerFn, mountPointId, groups, use, defaultArgs, defaultShow);\r\n if (lastMountPoint !== mountPointId) {\r\n this.notifyMountPoint(lastMountPoint);\r\n this.notifyMountPoint(mountPointId);\r\n } else {\r\n this.notifyLayer(id);\r\n }\r\n }\r\n\r\n reset(id: ID) {\r\n this._core.reset(id);\r\n this.notifyLayer(id)\r\n }\r\n\r\n unregister(id: ID) {\r\n this._core.unregister(id);\r\n }\r\n\r\n show (id: ID, args: Array) {\r\n this._core.show(id, args);\r\n this.notifyLayer(id);\r\n }\r\n\r\n update(id: ID, args: Array) {\r\n this._core.update(id, args);\r\n this.notifyLayer(id);\r\n }\r\n\r\n hide (id: ID) {\r\n const stack = this.getStack();\r\n this._core.hide(id);\r\n this.notifyLayer(id);\r\n }\r\n}\r\n"]}