What is a Ferp Action?
Actions
Types of Actions
Naked Action
import { effects } from 'ferp';
const IncrementCounterByOne = (state) => [
{ ...state, counter: state.counter + 1 },
effects.none(),
];import { app, effects } from 'ferp';
const IncrementCounterByOne = (state) => [
{ ...state, counter: state.counter + 1 },
effects.none(),
];
const dispatch = app({
init: [
{ counter: 0 },
effects.act(IncrementCounterByOne), // run an action via effect
],
});
dispatch(IncrementCounterByOne); // run an action via dispatchAction Builder
Last updated