https://github.com/josephdavis/perception
Perceive events and observables with ease in JavaScript.
https://github.com/josephdavis/perception
javascript javascript-library node-module nodejs observable observables
Last synced: 25 days ago
JSON representation
Perceive events and observables with ease in JavaScript.
- Host: GitHub
- URL: https://github.com/josephdavis/perception
- Owner: JosephDavis
- License: other
- Created: 2016-03-18T23:16:04.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2016-05-09T22:28:39.000Z (about 10 years ago)
- Last Synced: 2025-10-06T02:24:35.988Z (8 months ago)
- Topics: javascript, javascript-library, node-module, nodejs, observable, observables
- Language: JavaScript
- Homepage:
- Size: 27.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Perception
============
[](https://travis-ci.org/JosephDavis/perception)
[](https://www.npmjs.com/package/perception)
Perceive events and observables with ease.
Table of Contents
-----------------
- [Requirements](#requirements)
- [Usage](#usage)
- [Installation](#installation)
- [Documentation](#documentation)
- [License](#license)
Requirements
------------
For use in a Node.js environment:
- [Node.js](https://nodejs.org)
- [npm](https://npmjs.com)
Usage
-----
```js
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](http://www.apache.org/licenses/LICENSE-2.0.html). See `LICENSE` for details.
Copyright © 2016, Joey Davis (github.com/JosephDavis)