mirror of
https://github.com/vale981/event-pubsub
synced 2025-03-04 17:11:38 -05:00
Merge pull request #12 from mrvini/master
Removing unused variables initializations thanks @mrvini
This commit is contained in:
commit
c8b193095c
6 changed files with 40 additions and 151 deletions
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
npm-debug.log
|
1
.npmignore
Normal file
1
.npmignore
Normal file
|
@ -0,0 +1 @@
|
||||||
|
examples/
|
6
es5.js
6
es5.js
|
@ -9,8 +9,7 @@ function EventPubSub() {
|
||||||
|
|
||||||
function on(type,handler){
|
function on(type,handler){
|
||||||
if(!handler){
|
if(!handler){
|
||||||
const err=new ReferenceError('handler not defined.');
|
throw new ReferenceError('handler not defined.');
|
||||||
throw(err);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!this._events_[type]){
|
if(!this._events_[type]){
|
||||||
|
@ -27,8 +26,7 @@ function EventPubSub() {
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!handler){
|
if(!handler){
|
||||||
var err=new ReferenceError('handler not defined. if you wish to remove all handlers from the event please pass "*" as the handler');
|
throw new ReferenceError('handler not defined. if you wish to remove all handlers from the event please pass "*" as the handler');
|
||||||
throw err;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(handler=='*'){
|
if(handler=='*'){
|
||||||
|
|
6
es6.js
6
es6.js
|
@ -10,8 +10,7 @@ class EventPubSub {
|
||||||
|
|
||||||
on( type, handler ) {
|
on( type, handler ) {
|
||||||
if ( !handler ) {
|
if ( !handler ) {
|
||||||
const err=new ReferenceError('handler not defined.');
|
throw new ReferenceError( 'handler not defined.' );
|
||||||
throw(err);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( !this._events_[ type ] ) {
|
if ( !this._events_[ type ] ) {
|
||||||
|
@ -28,8 +27,7 @@ class EventPubSub {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( !handler ) {
|
if ( !handler ) {
|
||||||
var err=new ReferenceError('handler not defined. if you wish to remove all handlers from the event please pass "*" as the handler');
|
throw new ReferenceError( 'handler not defined. if you wish to remove all handlers from the event please pass "*" as the handler' );
|
||||||
throw err;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( handler == '*' ) {
|
if ( handler == '*' ) {
|
||||||
|
|
109
npm-debug.log
109
npm-debug.log
File diff suppressed because one or more lines are too long
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "event-pubsub",
|
"name": "event-pubsub",
|
||||||
"version": "4.2.3",
|
"version": "4.2.4",
|
||||||
"description": "Super light and fast Extensible PubSub events and EventEmitters for Node and the browser with support for ES6 by default, and ES5 versions for older verions of node and older IE/Safari versions. Easy for any developer level. No frills, just high speed pubsub events!",
|
"description": "Super light and fast Extensible PubSub events and EventEmitters for Node and the browser with support for ES6 by default, and ES5 versions for older verions of node and older IE/Safari versions. Easy for any developer level. No frills, just high speed pubsub events!",
|
||||||
"main": "event-pubsub.js",
|
"main": "event-pubsub.js",
|
||||||
"directories": {
|
"directories": {
|
||||||
|
|
Loading…
Add table
Reference in a new issue