RunKit + npm: effector

node v11.15.0
endpointsharetweet
const { createStore, createEvent } = require("effector") const incr = createEvent('foo') const decr = createEvent('bar') const another = createEvent('another') const store = createStore(0) .on(incr, (state, value) => state + value) .on(decr, (state, value) => state - value) .watch((value) => console.log(`triggered ${value}`)) another(100) incr(1) incr(2) decr(3) another(200)
Created from: https://npm.runkit.com/effector
Loading…