Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

eventproxy

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eventproxy - npm Package Compare versions

Comparing version 0.1.1 to 0.1.2

.travis.yml

7

eventproxy.js

@@ -185,6 +185,10 @@ /*global exports */

_all = function () {
_all = function (event) {
if (times < length) {
return;
}
if (!flag[event]) {
return;
}
var data = [];

@@ -197,2 +201,3 @@ for (index = 0; index < length; index++) {

}
callback.apply(null, data);

@@ -199,0 +204,0 @@ };

2

package.json

@@ -23,3 +23,3 @@ {

"main" : "eventproxy.js",
"version" : "0.1.1"
"version" : "0.1.2"
}
这个世界上不存在所谓回调函数深度嵌套的问题。 —— Jackson Tian(http://weibo.com/shyvo)
---
[![Build Status](https://secure.travis-ci.org/JacksonTian/eventproxy.png)](http://travis-ci.org/JacksonTian/eventproxy)
---

@@ -4,0 +7,0 @@

@@ -146,4 +146,6 @@ /**

assert.equal(counter, 2, 'counter should be incremented.');
ep.trigger('event3', "The event not in list");
assert.equal(counter, 2, 'counter should not be incremented.');
},
'after, n times': function() {

@@ -171,3 +173,17 @@ var ep = EventProxy.create();

},
'after, 1 time': function() {
var ep = EventProxy.create();
var counter = 0;
ep.after('event', 1, function(data) {
assert.deepEqual(data.length, 1);
assert.deepEqual(data[0], "1 time");
counter += 1;
});
ep.trigger('event', "1 time");
assert.deepEqual(counter, 1, 'counter should have only been incremented once.');
},
'after, 0 time': function () {

@@ -174,0 +190,0 @@ var obj = new EventProxy();

@@ -106,2 +106,4 @@ test("EventProxy - bind/trigger", function() {

equals(counter, 2, 'counter should be incremented.');
obj.trigger('event3', 'This event not in list');
equals(counter, 2, 'counter should not be incremented.');
});

@@ -130,2 +132,16 @@

test("EventProxy - after, 1 time", function() {
var obj = EventProxy.create();
var counter = 0;
obj.after('event', 1, function(data) {
equals(data.length, 1, "The data length should be 1.");
equals(data[0], "1 time", "The item should be 1 time.");
counter += 1;
});
obj.trigger('event', "1 time");
equals(counter, 1, 'counter should have only been incremented once.');
})
test("EventProxy - after, 0 time", function () {

@@ -132,0 +148,0 @@ var obj = new EventProxy();

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