deactive
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

deactive

The simplest Reactive Observable for all

Usage

import { deactive } from 'deactive';
// Or
const { deactive } = require('deactive');

const observer = (key, newVal, oldVal) => {
  console.log(`Key ${key} changed to ${newVal}! Old value is ${oldVal}`);
  return newVal;
};

const { ref, $ } = deactive(observer);

ref('aaa', 123);
ref('bbb', 456);

console.log($.aaa, $.bbb);

$.aaa = 789;
$.bbb = 1234;

console.log($.aaa, $.bbb);

License

MIT

Readme

Keywords

Package Sidebar

Install

npm i deactive

Weekly Downloads

2

Version

1.0.1

License

MIT

Unpacked Size

2.57 kB

Total Files

5

Last publish

Collaborators

  • classicoldsong