Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dark64/cuspin
Minimal Event Manager
https://github.com/dark64/cuspin
Last synced: 4 days 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 (about 5 years ago)
- Default Branch: master
- Last Pushed: 2019-10-17T13:46:56.000Z (about 5 years ago)
- Last Synced: 2024-12-11T04:31:42.536Z (about 1 month ago)
- Language: JavaScript
- Size: 9.77 KB
- Stars: 1
- Watchers: 2
- 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!']);
```