Skip to content

chenzesam/data-observer

Repository files navigation

数据观察器

Roadmap

  • feat: async observe.

  • feat: decouple Observable and Dep.

  • feat: add test.

Use

import Observable from '@czs/data-observer';
let data = { age: 18 };

let observer = new Observable(data);

// add reactive observe
observer.observe(function (data) {
  // log "my age is 18"
  console.log('my age is ' + data.age);
})

// change data, and will log "my age is 19"
observer.data.age += 1;

About

observer for data

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published