ows

0.3.1 • Public • Published

ows

Build Status GitHub version License

Simple observable like WeakSet

npm i ows

Usage

import OWS from 'ows';
 
const ows = new OWS();
 
ows.on(set => {});
ows.add('val'); // => emit change event

Methods

.on(handler)

inherit EventEmitter

Returns ows

.off(handler)

inherit EventEmitter

Returns ows

.add(payload);

add payload

successful emit change event

Returns ows

.delete(payload);

delete payload

successful emit change event

Returns Bool

.has(payload);

has payload

Returns Bool

.clear(payload);

clear set

successful emit change event

Returns ows

Contributing

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D

License

MIT

© sugarshin

Readme

Keywords

none

Package Sidebar

Install

npm i ows

Weekly Downloads

1

Version

0.3.1

License

MIT

Last publish

Collaborators

  • sugarshin