resources/assets/js/app-v1/utils/redux/utils/createRequestAction.js
/**
 * Create a request-action that attaches meta-data for the request-system to check
 * if the data for the request is cached or not.
 * 
 * @param {string} type - The request type (i.e: USERS_FETCH_ALL)
 * @param {function} request - The request function returning a promise
 * @param {function} selector - The selector for selecting the cache-status in state.
 * I.e: a property in the state that marks the cache dirty or clean (true|false)
 */
Create a request-action that attaches meta-data for the request-system to check
if the data for the request is cached or not.

@param {string} type - The request type
@param {function} request - The request function returning a promise
@param {function} selector - The selector for selecting the cache-status in state.
I.e: a property in the state that marks the cache dirty or clean (true|false)
Create a request - action that attaches meta - data for the request - system to check if the data for the request is cached or not . @param { string } type - The request type @param { function } request - The request function returning a promise @param { function } selector - The selector for selecting the cache - status in state . I . e : a property in the state that marks the cache dirty or clean ( true|false )
function createRequestActionForCacheable(type, request, selector) {
  invariant( isFunction(selector), 'Expected cacheSelector to be a function')
  const metaCreator = () => { return { checkCache: true, cacheSelector: selector }}
  return createRequestAction(type, request, null, metaCreator)
}
function createRequestActionForCacheable ( type , request , selector ) { invariant ( isFunction ( selector ) , 'Expected cacheSelector to be a function' ) const metaCreator = ( ) => { return { checkCache : true , cacheSelector : selector } } return createRequestAction ( type , request , null , metaCreator ) }
Create a request-action that attaches meta-data for the request-system to check
 if the data for the request is cached or not.
Create a request - action that attaches meta - data for the request - system to check if the data for the request is cached or not .
// Check if the selector is a valid function