1.0.24 • Published 5 years ago

@devinle/sonar v1.0.24

Weekly downloads
1
License
MIT
Repository
github
Last release
5 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

5 years ago

1.0.23

5 years ago

1.0.22

5 years ago

1.0.21

5 years ago

1.0.20

5 years ago

1.0.19

5 years ago

1.0.18

5 years ago

1.0.17

5 years ago

1.0.16

5 years ago

1.0.15

5 years ago

1.0.14

5 years ago

1.0.13

5 years ago

1.0.12

5 years ago

1.0.11

5 years ago

1.0.10

5 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.0

5 years ago