RunKit + npm: effector

node v11.15.0
endpointsharetweet
const { createStore, createEffect } = require('effector') const effect = createEffect() .use((value) => new Promise(res => setTimeout(res, value, 200))) const store = createStore('initial') store.watch(effect, (state, params) => console.log(`executed with ${params}`)) store.watch(effect.done, (state, { params, result }) => console.log(`executed with ${params}, resolved with ${result}`)) store.watch(effect.fail, (state, { params, result }) => console.log(`rejected with ${params}, resolved with ${result}`)) effect(100)
Created from: https://npm.runkit.com/effector
Loading…