1.0.10 • Published 4 years ago

@cspruit/zephyr v1.0.10

Weekly downloads
11
License
GPL-3.0-or-later
Repository
github
Last release
4 years ago

Build Status codecov npm license XO code style Greenkeeper badge

Zephyr

Zephyr is a lightweight javascript library that handles events and streams.

Installation

  • Install by running npm install --save @cspruit/zephyr in the same directory as the package.json file lives.

Usage

For Application events

import {EventRegistry} from '@cspruit/zephyr';

const registry = new EventRegistry();
registry.listen('My Cool Event', () => console.log('Hello world!'));
registry.sendEvent('My Cool Event'); // Should trigger 'Hello world!'

For Element events

  • Zephyr provides a wrapper around the normal element.addEventListener function that will filter for specific keypresses and other non-standard event types.
import {listen, EventTypes} from '@cspruit/zephyr';

const submitField = document.createElement('input');
listen(el, EventTypes.enter, () => console.log('enter was pressed!'));

Contributing

All contributions, suggestions, and issues are welcome!

Check out the Issues page. In general anything listed is up for grabs, though bugs tend to be more detailed than enhancements and might be better to pick up if starting out.

License

This project uses GPL 3.0.

1.0.10

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago