https://github.com/dark64/cuspin
Minimal Event Manager
https://github.com/dark64/cuspin
Last synced: about 2 months ago
JSON representation
Minimal Event Manager
- Host: GitHub
- URL: https://github.com/dark64/cuspin
- Owner: dark64
- License: isc
- Created: 2019-10-15T21:03:03.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2019-10-17T13:46:56.000Z (almost 7 years ago)
- Last Synced: 2025-10-29T00:07:30.484Z (9 months ago)
- Language: JavaScript
- Size: 9.77 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# cuspin
> Minimal JavaScript Event Manager
## Install
```bash
npm install cuspin
```
## Usage
```javascript
import { subscribe, subscribeOnce, emit } from 'cuspin';
// subscribe to an event
subscribe('example', (args) => {
console.log(args)
})
// subscribe once to an event
subscribeOnce('example', (args) => {
console.log(args);
})
// emit event
emit('example', 'Hello world!');
emit('example', { message: 'Hello world!' });
emit('example', ['Hello', 'world!']);
```