src/actionFn.js
/**
   * Fetch data from server
   * @param  {Object}   pathvars    path vars for url
   * @param  {Object}   params      fetch params
   * @param  {Function} getState    helper meta function
   */
Fetch data from server
@param  {Object}   pathvars    path vars for url
@param  {Object}   params      fetch params
@param  {Function} getState    helper meta function
Fetch data from server @param { Object } pathvars path vars for url @param { Object } params fetch params @param { Function } getState helper meta function
function request(
    pathvars,
    params,
    options,
    getState = none,
    dispatch = none
  ) {
    const response = fetch(pathvars, params, options, getState, dispatch);
    const result = !meta.validation
      ? response
      : response.then(
          data =>
            new Promise((resolve, reject) =>
              meta.validation(data, err => (err ? reject(err) : resolve(data)))
            )
        );
    let ret = result;
    const responseHandler = get(meta, "holder", "responseHandler");
    if (responseHandler) {
      if (result && result.then) {
        ret = result.then(
          data => {
            const res = responseHandler(null, data);
            if (res === undefined) {
              return data;
            } else {
              return res;
            }
          },
          err => responseHandler(err)
        );
      } else {
        ret = responseHandler(result);
      }
    }
    ret && ret.catch && ret.catch(none);
    return ret;
  }
function request ( pathvars , params , options , getState = none , dispatch = none ) { const response = fetch ( pathvars , params , options , getState , dispatch ) ; const result = ! meta . validation ? response : response . then ( data => new Promise ( ( resolve , reject ) => meta . validation ( data , err => ( err ? reject ( err ) : resolve ( data ) ) ) ) ) ; let ret = result ; const responseHandler = get ( meta , "holder" , "responseHandler" ) ; if ( responseHandler ) { if ( result && result . then ) { ret = result . then ( data => { const res = responseHandler ( null , data ) ; if ( res === undefined ) { return data ; } else { return res ; } } , err => responseHandler ( err ) ) ; } else { ret = responseHandler ( result ) ; } } ret && ret . catch && ret . catch ( none ) ; return ret ; }
Fetch data from server
 @param  {Object}   pathvars    path vars for url
 @param  {Object}   params      fetch params
 @param  {Function} getState    helper meta function
Fetch data from server @param { Object } pathvars path vars for url @param { Object } params fetch params @param { Function } getState helper meta function