mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-24 23:48:13 -05:00
13 lines
316 B
JavaScript
13 lines
316 B
JavaScript
|
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 {};
|
||
|
}
|