The Boilerplate
Application Anatomy
init: [state, effect]
import { app, effects } from 'ferp';
const INITIAL_STATE = { counter: 1 };
app({ init: [INITIAL_STATE, effects.none()] });subscribe: (state) => []
import { app, effects } from 'ferp';
import mySubscription from './mySubscription.js';
const INITIAL_STATE = { counter: 1 };
app({
init: [INITIAL_STATE, effects.none()],
subscribe: (state) => [mySubscription, state.counter < 10]
});observe: ([currentState, currentEffect], actionAnnotation) => {}
const dispatch = app({ ... })
The Counter App
Last updated