Core Effects
The basic effects that Ferp provides to help you build better software
effects.none()
effects.defer(promiseLike)
import { effects } from 'ferp';
const fetchEffect = (url, options, okEffect) => effects.defer(
fetch(url, options)
.then(response => response.json())
.then(okEffect)
);
// Usage:
fetchEffect(
'https://jsonplaceholder.typicode.com/posts',
undefined,
(json) => ({ type: 'httpSuccess', json }),
);effects.thunk(() => effect)
effects.batch(arrayOfEffects)
effects.act(actionFunction, alias)
Last updated