This package allows you to observe changes made on values.
npm i @stein197/value
The package includes only single class Value
:
import Value from "@stein197/value";
const v = new Value(12);
v.on((oldValue, newValue) => console.log(oldValue, newValue)); // Adding an event listener. The callback takes two arguments - the old value and the new one
v.get(); // 12
v.set(12); // Does not fire an event because the new value is the same as the old one
v.set(24);
> 12 24
clean
cleans working directory from compiled filests
compiles source codetest
runs unit testsbuild
all the previous scripts combined