New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

easy-eventbus

Package Overview
Dependencies
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

easy-eventbus - npm Package Compare versions

Comparing version 0.3.2 to 0.4.0

2

dist/eventBus.js

@@ -1,1 +0,1 @@

!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.eventBus=e():t.eventBus=e()}(window,(function(){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(n,i,function(e){return t[e]}.bind(null,i));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=0)}([function(t,e,r){"use strict";r.r(e),r.d(e,"EasySubscriber",(function(){return n}));var n=function(){function t(t){this.listeners=[],this.id=-1,Object.defineProperty(this,"id",{value:t,writable:!1})}return t.prototype.addListener=function(t,e){var r=0;this.listeners.some((function(e,n){var i=e.type===t;return i&&(r=n),i}))?(console.warn("EasEventBus: 添加的事件 "+t+" 有重复,已覆盖"),this.listeners[r]={type:t,func:e}):this.listeners.push({type:t,func:e})},t.prototype.addListeners=function(t){var e=this,r=this.listeners.map((function(t){return t.type}));t.forEach((function(t){var n=t.type,i=t.fn;r.includes(n)?(console.warn("EasEventBus: 添加的事件 "+n+" 有重复,已覆盖"),e.listeners=e.listeners.map((function(t){return t.type===n?{type:n,func:i}:t}))):e.listeners.push({type:n,func:i})}))},t.prototype.removeListener=function(t){this.listeners=this.listeners.filter((function(e){return e.type!==t}))},t.prototype.removeListeners=function(t){this.listeners=this.listeners.filter((function(e){return!t.includes(e.type)}))},t.prototype.removeAllListener=function(){this.listeners=[]},t.prototype.getListener=function(){return this.listeners},t}(),i=function(){function t(){this.subscribers=[],this.subscribers=[],this.id=0,this.count=0}return t.prototype.createSubscriber=function(){this.count+=1,this.$emit("create"),this.id+=1;var t=this.id;return this.subscribers.push(new n(t)),this.subscribers[this.subscribers.length-1]},t.prototype.$emit=function(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];this.subscribers.forEach((function(r){r.listeners.some((function(r){return r.type===t&&(r.func.apply(r,e),!0)}))}))},t.prototype.dispatch=function(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];this.$emit.apply(this,[t].concat(e))},t.prototype.removeSubscriber=function(t){var e=this;return this.subscribers.some((function(r,n){return r.id===t&&(e.subscribers[n]=null,e.subscribers.splice(n,1),e.count-=1,!0)}))},t.prototype.removeAllSubscriber=function(){this.count=0,this.subscribers=[]},t.prototype.getSubscriber=function(t){return t?this.subscribers.filter((function(e){return e.id===t}))[0]:this.subscribers},t}();e.default=i}])}));
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.eventBus=e():t.eventBus=e()}(self,(()=>(()=>{"use strict";var t={};return{607:function(t,e){var r=this&&this.__spreadArray||function(t,e,r){if(r||2===arguments.length)for(var s,n=0,i=e.length;n<i;n++)!s&&n in e||(s||(s=Array.prototype.slice.call(e,0,n)),s[n]=e[n]);return t.concat(s||Array.prototype.slice.call(e))};Object.defineProperty(e,"__esModule",{value:!0}),e.EasySubscriber=void 0;var s=function(){function t(t){this.listeners=[],this.id=-1,Object.defineProperty(this,"id",{value:t,writable:!1})}return t.prototype.on=function(t,e){this.addListener(t,e)},t.prototype.once=function(t,e){var r=this;this.addListener(t,(function(){r.removeListener(t),e()}))},t.prototype.addListener=function(t,e){var r=0;this.listeners.some((function(e,s){var n=e.type===t;return n&&(r=s),n}))?(console.warn("EasEventBus: 添加的事件 ".concat(t," 有重复,已覆盖")),this.listeners[r]={type:t,func:e}):this.listeners.push({type:t,func:e})},t.prototype.addListeners=function(t){var e=this,r=this.listeners.map((function(t){return t.type}));t.forEach((function(t){var s=t.type,n=t.fn;r.includes(s)?(console.warn("EasEventBus: 添加的事件 ".concat(s," 有重复,已覆盖")),e.listeners=e.listeners.map((function(t){return t.type===s?{type:s,func:n}:t}))):e.listeners.push({type:s,func:n})}))},t.prototype.removeListener=function(t){this.listeners=this.listeners.filter((function(e){return e.type!==t}))},t.prototype.removeListeners=function(t){this.listeners=this.listeners.filter((function(e){return!t.includes(e.type)}))},t.prototype.removeAllListener=function(){this.listeners=[]},t.prototype.getListener=function(){return this.listeners},t}();e.EasySubscriber=s;var n=function(){function t(){this.subscribers=[],this.subscribers=[],this.id=0,this.count=0}return t.prototype.createSubscriber=function(){this.count+=1,this.$emit("create"),this.id+=1;var t=this.id;return this.subscribers.push(new s(t)),this.subscribers[this.subscribers.length-1]},t.prototype.$emit=function(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];this.subscribers.forEach((function(r){r.listeners.some((function(r){return r.type===t&&(r.func.apply(r,e),!0)}))}))},t.prototype.dispatch=function(t){for(var e=[],s=1;s<arguments.length;s++)e[s-1]=arguments[s];this.$emit.apply(this,r([t],e,!1))},t.prototype.removeSubscriber=function(t){var e=this;return this.subscribers.some((function(r,s){return r.id===t&&(e.subscribers[s]=null,e.subscribers.splice(s,1),e.count-=1,!0)}))},t.prototype.removeAllSubscriber=function(){this.count=0,this.subscribers=[]},t.prototype.getSubscriber=function(t){return t?this.subscribers.filter((function(e){return e.id===t}))[0]:this.subscribers},t}();e.default=n}}[607](0,t),t})()));
{
"name": "easy-eventbus",
"version": "0.3.2",
"version": "0.4.0",
"description": "this is a library for eventbus",

@@ -8,10 +8,10 @@ "main": "index.js",

"scripts": {
"unit": "cross-env NODE_ENV=test karma start test/karma.conf.js",
"dev": "cross-env NODE_ENV=development webpack-dev-server --open --inline --hot --port 9923",
"build": "cross-env NODE_ENV=production webpack",
"release": "standard-version"
"release": "standard-version",
"test": "jest --watch"
},
"keywords": [
"eventbus",
"event"
"easy-eventbus"
],

@@ -24,46 +24,6 @@ "repository": {

"license": "ISC",
"bugs": {},
"devDependencies": {
"babel-cli": "^6.26.0",
"babel-eslint": "^8.2.2",
"babel-loader": "^7.1.4",
"babel-polyfill": "^6.26.0",
"chai": "^4.1.2",
"cross-env": "^5.1.4",
"css-loader": "^0.28.11",
"cz-conventional-changelog": "^2.1.0",
"eslint": "^4.19.1",
"eslint-config-standard": "^11.0.0",
"eslint-friendly-formatter": "^4.0.0",
"eslint-import-resolver-webpack": "^0.9.0",
"eslint-loader": "^2.0.0",
"eslint-plugin-html": "^4.0.2",
"eslint-plugin-import": "^2.10.0",
"eslint-plugin-promise": "^3.7.0",
"extract-text-webpack-plugin": "^4.0.0-beta.0",
"html-webpack-plugin": "^3.2.0",
"istanbul-instrumenter-loader": "^3.0.1",
"karma": "^2.0.2",
"karma-chai": "^0.1.0",
"karma-chrome-launcher": "^2.2.0",
"karma-coverage": "^1.1.2",
"karma-coverage-istanbul-reporter": "^2.0.1",
"karma-mocha": "^1.3.0",
"karma-remap-coverage": "^0.1.5",
"karma-sourcemap-loader": "^0.3.7",
"karma-spec-reporter": "^0.0.32",
"karma-webpack": "^3.0.0",
"mocha": "^5.2.0",
"node-sass": "^4.8.3",
"ora": "^3.0.0",
"sass-loader": "^6.0.7",
"standard-version": "^9.1.1",
"style-loader": "^0.20.3",
"ts-loader": "^5.3.2",
"typescript": "^3.1.2",
"uglifyjs-webpack-plugin": "^1.2.4",
"webpack": "^4.19.0",
"webpack-cli": "^3.1.1",
"webpack-dev-server": "^3.1.1"
"bugs": {
"url": "https://github.com/rni-l/eventBus/issues"
},
"homepage": "https://github.com/rni-l/eventBus#readme",
"pluginName": "eventBus",

@@ -78,3 +38,24 @@ "config": {

"types"
]
],
"devDependencies": {
"@babel/cli": "^7.17.6",
"@babel/core": "^7.17.9",
"@babel/preset-env": "^7.16.11",
"@babel/preset-typescript": "^7.16.7",
"@types/jest": "^27.4.1",
"@typescript-eslint/eslint-plugin": "^5.18.0",
"@typescript-eslint/parser": "^5.18.0",
"babel-loader": "^8.2.4",
"chai": "^4.3.6",
"cross-env": "^7.0.3",
"cz-conventional-changelog": "^3.3.0",
"eslint": "^8.12.0",
"eslint-friendly-formatter": "^4.0.1",
"jest": "^27.5.1",
"standard-version": "^9.3.2",
"ts-loader": "^9.2.8",
"typescript": "^4.6.3",
"webpack": "^5.72.0",
"webpack-cli": "^4.9.2"
}
}

@@ -6,5 +6,6 @@ /**

*/
declare type EmptyFn = (...args: unknown[]) => void;
declare type EasyListener = {
type: string;
func: Function;
func: EmptyFn;
};

@@ -15,2 +16,4 @@ declare class EasySubscriber {

constructor(id: number);
on(type: string, fn: EmptyFn): void;
once(type: string, fn: EmptyFn): void;
/**

@@ -22,3 +25,3 @@ * 当前的订阅者,添加订阅事件

*/
addListener(type: string, fn: Function): void;
addListener(type: string, fn: EmptyFn): void;
/**

@@ -33,3 +36,3 @@ * 当前的订阅者,添加多个订阅事件

type: string;
fn: Function;
fn: EmptyFn;
}[]): void;

@@ -90,3 +93,3 @@ /**

*/
$emit(type: string, ...args: any[]): void;
$emit(type: string, ...args: unknown[]): void;
/**

@@ -99,3 +102,3 @@ * 触发所有订阅者,指定的事件

*/
dispatch(type: string, ...args: any[]): void;
dispatch(type: string, ...args: unknown[]): void;
/**

@@ -121,5 +124,5 @@ * 移除某个订阅者

*/
getSubscriber(id: number): EasySubscriber | EasySubscriber[];
getSubscriber(id?: number): EasySubscriber | EasySubscriber[];
}
export { EasyListener, EasySubscriber };
export default EasyEventbus;
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc