Runkit
Runkit
home page
user forum
new notebook
clone notebook
download notebook
support & documentation
log in
sign up
new notebook
help & feedback
clone this notebook
download this notebook
Sign In
Sign Up
RunKit + npm: effector
node v11.15.0
endpoint
share
tweet
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…
Clone and edit this document