1.0.11 • Published 6 years ago

ely v1.0.11

Weekly downloads
12
License
Unlicense
Repository
github
Last release
6 years ago

ely npm version Build Status Coverage Status devDependencies Status

ely - Emit Light and Yell

Make any object parameters emittable

Make listening for changes easier with automatic property change emitter.

Install:

Install with npm

npm install ely

Use standalone

<script src="https://cdn.jsdelivr.net/npm/ely/standalone/ely.js"></script>
or
<script src="https://cdn.jsdelivr.net/npm/ely/standalone/ely.min.js"></script>

Access the library:

Import

import { ely } from 'ely';

Require

const ely = require('ely');

Standalone

<script src="https://cdn.jsdelivr.net/npm/ely/standalone/ely.min.js"></script>
<script>
// global ely variable exists
</script>

Basics:

ely static

Ely library provides a static library to map and unmap objects. Map returns emitter with signals named as every property that can be monitored. Also you have '*' to monitor all changes within a single place.

import { ely } from 'ely';

const object = {
  a: 'value of a',
  b: 'value of b'
};

const emitter = ely.map(object);

emitter.on('a', (_new, _old) => {
  console.log(_new, _old);
});
emitter.on('*', (_new, _old, key) => {
  console.log(_new, _old, key);
});

object.a = 'new value of a';
object.b = 'new value of b';

More examples

Check the examples

Documentation

Check the documentation

What is next

Check the todo

What have changed

Check the changelog

1.0.11

6 years ago

1.0.10

6 years ago

1.0.8

7 years ago

1.0.7

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago