mirror of
https://github.com/Start9Labs/start-sdk.git
synced 2026-03-26 02:11:56 +00:00
21 lines
593 B
TypeScript
21 lines
593 B
TypeScript
import { Effects, ExpectedExports, ExportedAction } from "../types";
|
|
import { ActionMetaData } from "../types";
|
|
import { CreatedAction } from "./createAction";
|
|
|
|
export function setupActions(...createdActions: CreatedAction<any, any>[]) {
|
|
const actions: Record<string, ExportedAction> = {};
|
|
for (const action of createdActions) {
|
|
actions[action.metaData.id] = action.exportedAction;
|
|
}
|
|
|
|
const manifestActions = async (effects: Effects) => {
|
|
for (const action of createdActions) {
|
|
action.exportAction(effects);
|
|
}
|
|
};
|
|
return {
|
|
actions,
|
|
manifestActions,
|
|
};
|
|
}
|