import { createAction } from "redux-act";
// slightly simplified version of the creator used in the cloud
// we will unify it when some typing issues will be fixed (cloud version didn't warn on bad payload)
export const createRequestAction = (name) => {
    const action = createAction(name.toUpperCase());
    return Object.assign(action, {
        request: action,
        success: createAction(`${name.toUpperCase()}_SUCCESS`, (payload) => payload, (meta) => meta),
        failure: createAction(`${name.toUpperCase()}_FAILURE`, (payload) => payload, (meta) => ({
            ...meta,
            error: true,
        })),
    });
};
//# sourceMappingURL=createRequestAction.js.map