Skip to content

Latest commit

 

History

History
32 lines (24 loc) · 587 Bytes

README.md

File metadata and controls

32 lines (24 loc) · 587 Bytes

Delta Watch

Object watching utility for JavaScript

Example

import DeltaWatch from "delta-watch";

// Create watchable object with inital values
let watchable = DeltaWatch.Watchable({
    value: "Initial"
});

DeltaWatch.Watch(watchable.Watcher.value, (value: string) => {
    console.log("new value", value);
});

watchable.Mutator.value = "Changed"; // cb gets call with "Changed"

// May also access current value
console.log(watchable.Accessor);
// logs "Changed"

Starting the example app

cd packages/examples
npm install

npm run build
npm start