All Downloads are FREE. Search and download functionalities are using the official Maven repository.

actions.actionImpl.ts Maven / Gradle / Ivy

There is a newer version: 7.28.2
Show newest version
import {
    START_INVOKE,
    SUCCESS_INVOKE,
    FAIL_INVOKE,
} from '../constants/actionImpls'

import createActionHelper from './createActionHelper'

/**
 * Экшен начала инвока
 * @param datasource
 * @param dataProvider
 * @param model
 * @param pageId
 * @param meta
 */
export function startInvoke(
    datasource: string,
    dataProvider: Record,
    model: Record,
    pageId: string,
    meta = {},
) {
    return createActionHelper(START_INVOKE)(
        {
            datasource,
            dataProvider,
            model,
            pageId,
        },
        meta,
    )
}

/**
 * Экшен удачного завершения инвока
 * @param datasource
 * @param meta
 */
export function successInvoke(datasource: string, meta: Record) {
    return createActionHelper(SUCCESS_INVOKE)({ datasource }, meta)
}

/**
 * Экшен неудачного завершения инвока
 * @param datasource
 * @param meta
 */
export function failInvoke(datasource: string, meta: Record) {
    return createActionHelper(FAIL_INVOKE)({ datasource }, meta)
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy