x-observable

Observable value class.

Usage no npm install needed!

<script type="module">
  import xObservable from 'https://cdn.skypack.dev/x-observable';
</script>

README

Observable

Observable is a JavaScript library providing observable value implementation.

Examples

var Observable = require('x-observable');

var observable = new Observable(1);
observable.changed.addListener(function(newValue, oldValue) {
    // newValue = 2, oldValue = 1
});
observable.setValue(2);

Method aliases

getValue - get.
setValue - set.

Installation

npm install --save x-observable