const Actions = { // Put your actions here }; /** Handle actions in the App, returns updated state */ export default async function ActionHandler({action, data, state, api}) { const handler = Actions[action]; if (handler) { return await handler({data, state, api}) || {}; } return {}; }