src/application/action-builder.js
function _preServiceCall({ node, type, preStatus, callerId, shouldDumpStoreOnActionCall }, payload) {
    //There is a problem if the node is empty. //Node should be an array
    let data = {};
    let status = {};
    const STATUS = { name: preStatus, isLoading: true };
    type = shouldDumpStoreOnActionCall ? 'update' : 'updateStatus';
    // When there is a multi node update it should be an array.
    if (Array.isArray(node)) {
        node.forEach((nd) => {
            data[nd] = shouldDumpStoreOnActionCall ? null : (payload && payload[nd]) || null;
            status[nd] = STATUS;
        });
    } else {
        data[node] = shouldDumpStoreOnActionCall ? null : (payload || null);
        status[node] = STATUS;
    }
    //Dispatch store cleaning.
    dispatcher.handleViewAction({ data, type, status, callerId });
}
function _preServiceCall({ node, type, preStatus, callerId, shouldDumpStoreOnActionCall }, payload) {
    //There is a problem if the node is empty. //Node should be an array
    let data = {};
    let status = {};
    const STATUS = { name: preStatus, isLoading: true };
    type = shouldDumpStoreOnActionCall ? 'update' : 'updateStatus';
    // When there is a multi node update it should be an array.
    if (Array.isArray(node)) {
        node.forEach((nd) => {
            data[nd] = shouldDumpStoreOnActionCall ? null : (payload && payload[nd]) || null;
            status[nd] = STATUS;
        });
    } else {
        data[node] = shouldDumpStoreOnActionCall ? null : (payload || null);
        status[node] = STATUS;
    }
    //Dispatch store cleaning.
    dispatcher.handleViewAction({ data, type, status, callerId });
}
function _preServiceCall ( { node , type , preStatus , callerId , shouldDumpStoreOnActionCall } , payload ) { //There is a problem if the node is empty. //Node should be an array let data = { } ; let status = { } ; const STATUS = { name : preStatus , isLoading : true } ; type = shouldDumpStoreOnActionCall ? 'update' : 'updateStatus' ; // When there is a multi node update it should be an array. if ( Array . isArray ( node ) ) { node . forEach ( ( nd ) => { data [ nd ] = shouldDumpStoreOnActionCall ? null : ( payload && payload [ nd ] ) || null ; status [ nd ] = STATUS ; } ) ; } else { data [ node ] = shouldDumpStoreOnActionCall ? null : ( payload || null ) ; status [ node ] = STATUS ; } //Dispatch store cleaning. dispatcher . handleViewAction ( { data , type , status , callerId } ) ; }
Method call before the service.
@param {object} config The action builder config.
@param {obejct} payload Payload to dispatch.
Method call before the service .