@ray-js/wechat-event 0.1.2-beta-2 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.esm.js CHANGED
@@ -1 +1 @@
1
- import{getGlobal as n}from"@ray-js/wechat-helper";const o=n();function e(n){let e={};if(null==n?void 0:n.globalKey){const{globalKey:t}=n;o[t]?e=o[t]:o[t]=e}function t(n,o,t){e[n]||(e[n]=[]);const c=e[n].findIndex((n=>n.cb===o));-1===c?e[n].push({type:t,cb:o}):e[n][c].type!==t&&(e[n][c].type=t)}return{on:function(n,o){t(n,o,"on")},off:function(n,o){e[n]&&e[n].some(((t,c)=>t.cb===o&&(e[n].splice(c,1),!0)))},once:function(n,o){t(n,o,"once")},emit:function(n,o){if(e[n]){const t=[...e[n]],c=t.length;for(let n=0;n<c;n++){const{cb:c,type:l}=t[n];"once"===l&&e[l].splice(n,1);try{c(o)}catch(n){console.error(n)}}}},clear:()=>{e={}}}}var t=e();export{e as createEmitter,t as default};
1
+ import{getGlobal as n}from"@ray-js/wechat-helper";const o=n();function e(n){let e={};if(null==n?void 0:n.globalKey){const{globalKey:t}=n;o[t]?e=o[t]:o[t]=e}function t(n,o,t){e[n]||(e[n]=[]);const c=e[n].findIndex((n=>n.cb===o));-1===c?e[n].push({type:t,cb:o}):e[n][c].type!==t&&(e[n][c].type=t)}return{on:function(n,o){t(n,o,"on")},off:function(n,o){e[n]&&e[n].some(((t,c)=>t.cb===o&&(e[n].splice(c,1),!0)))},once:function(n,o){t(n,o,"once")},emit:function(n,o){if(e[n]){const t=[...e[n]],c=t.length;for(let l=0;l<c;l++){const{cb:c,type:f}=t[l];"once"===f&&e[n].splice(l,1);try{c(o)}catch(n){console.error(n)}}}},clear:()=>{e={}}}}var t=e();export{e as createEmitter,t as default};
package/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const e=require("@ray-js/wechat-helper").getGlobal();function t(t){let o={};if(null==t?void 0:t.globalKey){const{globalKey:n}=t;e[n]?o=e[n]:e[n]=o}function n(e,t,n){o[e]||(o[e]=[]);const c=o[e].findIndex((e=>e.cb===t));-1===c?o[e].push({type:n,cb:t}):o[e][c].type!==n&&(o[e][c].type=n)}return{on:function(e,t){n(e,t,"on")},off:function(e,t){o[e]&&o[e].some(((n,c)=>n.cb===t&&(o[e].splice(c,1),!0)))},once:function(e,t){n(e,t,"once")},emit:function(e,t){if(o[e]){const n=[...o[e]],c=n.length;for(let e=0;e<c;e++){const{cb:c,type:r}=n[e];"once"===r&&o[r].splice(e,1);try{c(t)}catch(e){console.error(e)}}}},clear:()=>{o={}}}}var o=t();exports.createEmitter=t,exports.default=o;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const e=require("@ray-js/wechat-helper").getGlobal();function t(t){let o={};if(null==t?void 0:t.globalKey){const{globalKey:n}=t;e[n]?o=e[n]:e[n]=o}function n(e,t,n){o[e]||(o[e]=[]);const c=o[e].findIndex((e=>e.cb===t));-1===c?o[e].push({type:n,cb:t}):o[e][c].type!==n&&(o[e][c].type=n)}return{on:function(e,t){n(e,t,"on")},off:function(e,t){o[e]&&o[e].some(((n,c)=>n.cb===t&&(o[e].splice(c,1),!0)))},once:function(e,t){n(e,t,"once")},emit:function(e,t){if(o[e]){const n=[...o[e]],c=n.length;for(let r=0;r<c;r++){const{cb:c,type:l}=n[r];"once"===l&&o[e].splice(r,1);try{c(t)}catch(e){console.error(e)}}}},clear:()=>{o={}}}}var o=t();exports.createEmitter=t,exports.default=o;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ray-js/wechat-event",
3
- "version": "0.1.2-beta-2",
3
+ "version": "0.1.3",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "registry": "https://registry.npmjs.org"
@@ -25,7 +25,7 @@
25
25
  }
26
26
  },
27
27
  "dependencies": {
28
- "@ray-js/wechat-helper": "^0.1.2-beta-2"
28
+ "@ray-js/wechat-helper": "^0.1.3"
29
29
  },
30
30
  "peerDependencies": {}
31
31
  }