1.0.24 • Published 6 years ago

@devinle/sonar v1.0.24

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

Sonar

A lightweight PubSub utility.

npm NPM GitHub last commit

Install

npm install @devinle/sonar

Usage

import { sonar } from 'sonar';

// Make a callback function
const callback = data => {};

// Register a callback with an event
// This event can receive data
sonar.on('evt', callback);

// Remove a specific callback from an event
sonar.off('evt', callback);

// Remove an entire event and all associated callbacks
sonar.off('evt');

// Trigger an event and send a payload object
sonar.trigger('evt', {...});

Tests

yarn test

License

MIT

1.0.24

6 years ago

1.0.23

6 years ago

1.0.22

6 years ago

1.0.21

6 years ago

1.0.20

6 years ago

1.0.19

6 years ago

1.0.18

6 years ago

1.0.17

6 years ago

1.0.16

6 years ago

1.0.15

6 years ago

1.0.14

6 years ago

1.0.13

6 years ago

1.0.12

6 years ago

1.0.11

6 years ago

1.0.10

6 years ago

1.0.9

6 years ago

1.0.8

6 years ago

1.0.7

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.0

6 years ago