perception

Perceive events and observables with ease

Usage no npm install needed!

<script type="module">
  import perception from 'https://cdn.skypack.dev/perception';
</script>

README

Perception

Build Status npm version

Perceive events and observables with ease.

Table of Contents

Requirements

For use in a Node.js environment:

Usage

const perception = require('perception');
const ObservableArray = perception.ObservableArray;

const array = new ObservableArray(1, 2, 3);
array.addListener('add', added => {
  console.log(`Added: ${added}!`);
});

array.push(4); // Console shows: 'Added: 4!'

Installation

To install as a dependency in your package.json file, run the following command:

npm install -S perception

Documentation

Perception provides several observable classes and an event dispatcher.

Observables:

  • ObservableArray
  • ObservableMap
  • ObservableSet
  • ObservableValue

Events:

  • EventDispatcher

For documentation, please refer to docs/current.md.

License

Perception is licensed under the Apache License 2.0. See LICENSE for details.

Copyright © 2016, Joey Davis (github.com/JosephDavis)