resources/assets/js/app-v1/utils/redux/requests/reducer.js
/**
 * removeActionFromList is called in several of the action handlers. It creates a new array
 * with all elements except for the matching request(s). In the case of multiple duplicates,
 * it removes only the first instance.
 */
removeActionFromList is called in several of the action handlers. It creates a new array
with all elements except for the matching request(s). In the case of multiple duplicates,
it removes only the first instance.
removeActionFromList is called in several of the action handlers . It creates a new array with all elements except for the matching request ( s ) . In the case of multiple duplicates it removes only the first instance .
function removeActionFromList(state, key, action) {
  const list = state[key];
  let firstInstance = true;
  return list.reduce((acc, request) => {
    if (
      request.meta.requestType === action.meta.requestType &&
      request.payload === action.payload &&
      firstInstance
    ) {
      firstInstance = false;
      return acc;
    }
    return acc.concat(request);
  }, []);
}
function removeActionFromList ( state , key , action ) { const list = state [ key ] ; let firstInstance = true ; return list . reduce ( ( acc , request ) => { if ( request . meta . requestType === action . meta . requestType && request . payload === action . payload && firstInstance ) { firstInstance = false ; return acc ; } return acc . concat ( request ) ; } , [ ] ) ; }
removeActionFromList is called in several of the action handlers.
removeActionFromList is called in several of the action handlers .