What Does Ferp Provide
An overview of exports in ferp
app()
import { app, effects } from 'ferp';
const initialState = 1;
const Add = state => [state + 1, effects.none()];
const addSubcription = (dispatch, intervalInMs) => {
const handle = setInterval(dispatch, intervalInMs, effects.act(Add));
return () => {
clearInterval(handle);
};
};
const dispatch = app({
init: [
initialState,
effects.none(),
],
subscribe: (state) => [
state < 10 && [addSubscription, 1000],
],
});effects {}
Last updated