0.0.1-security • Published 2 years ago

whevent v0.0.1-security

Weekly downloads
4
License
-
Repository
-
Last release
2 years ago

whevent

A lite and convenient event system

Just a simple singleton event system used by myself :)

Usage

var whevent = require('whevent');

// Bind the signal with the event function: whevent.bind(signal, func, context);
whevent.on('SPEAK', function1, this);

// Bind the signal with another event function, but this function will always get called first!
whevent.onPriority('SPEAK', function2, this);

// Bind the signal with a 3rd event function
// But once the function3 get called, the binding of this function with this signal will be destroyed
whevent.onOnce('SPEAK', function3, this);

// Call the event: whevent.call(signal, data);
// Calls order: function2, function1, function3
whevent.emit('SPEAK', 'Hello!');

// Unbind the binded function with the signal
whevent.off('SPEAK', function1);

// Unbind all the binded functions associated with the listener
whevent.offBy(listener);

// Destory the signal, all bindings will be destroyed
whevent.destroy('SPEAK');
0.0.1-security

2 years ago

2.1.1

4 years ago

2.1.0

4 years ago

2.0.6

5 years ago

2.0.5

5 years ago

2.0.4

5 years ago

2.0.3

6 years ago

2.0.2

6 years ago

2.0.1

6 years ago

2.0.0

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago