realar/readme/first

node v14.17.6
version: master
endpointsharetweet
const { value } = require('realar'); const store = value(0) const add = store.updater((state, num) => state + num) const inc = store.updater(state => state + 1) // Subscribe to store updates store.to(state => console.log(`state ${state}`)); inc(); // in console: state 1 add(4); // in console: state 5
Loading…

no comments

    sign in to comment