How to use the redial.trigger function in redial

To help you get started, we’ve selected a few redial examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github rocjs / roc-package-web-app-react / packages / roc-package-web-app-react / app / client / redux-context / index.js View on Github external
loadDataDefered(components, params, location, routeProps) {
        // Get deferred data, will not block route transitions
        trigger('defer', components, {
            location,
            params,
            dispatch: this.props.store.dispatch,
            getState: this.props.store.getState,
            routeProps
        }).catch((err) => {
            if (process.env.NODE_ENV !== 'production') {
                console.error('There was an error when fetching data: ', err);
            }
        });
    }
github hung-phan / koa-react-isomorphic / app / share / helpers / fetchData.js View on Github external
export const serverFetchData = (
  renderProps: Object,
  store: Object
): Promise =>
  trigger(
    FETCH_DATA_HOOK,
    renderProps.components,
    getDefaultParams(store, renderProps)
  );
github hung-phan / koa-react-isomorphic / app / client / helpers / fetchData.jsx View on Github external
createHandler(renderProps => {
      ReactDOM.render(, domNode);

      trigger(
        UPDATE_HEADER_HOOK,
        renderProps.components,
        getDefaultParams(renderProps)
      );
    })
  );
github hung-phan / koa-react-isomorphic / app / client / helpers / fetch-data.js View on Github external
export const serverFetchData = (renderProps, store) =>
  trigger(FETCH_DATA_HOOK, renderProps.components, getLocals(store, renderProps));
github tomatau / breko-hub / src / server / middleware / renderReactApp.js View on Github external
}, async (error, redirect, renderProps) => {
      if (error) {
        ctx.status = 500
        reject(ctx.throw(error))

      } else if (redirect) {
        ctx.status = 302
        reject(ctx.redirect(`${redirect.pathname}${redirect.search}`))

      } else if (!renderProps) {
        ctx.status = 404
        reject()

      } else {
        await trigger('prefetch', renderProps.components, {
          dispatch: ctx.store.dispatch,
          location: renderProps.location,
          params: renderProps.params,
        })
        resolve()
      }
    })
  })
github retaxJS / retax-seed / src / actions / lifecycle.js View on Github external
return async dispatch => {
      const { components } = renderProps;
      const locals = {
        dispatch,
        counterActionsCreator: this.actionsCreators.counter,
      };

      return trigger('fetch', components, locals);
    };
  }
github retaxJS / retax-seed / src / actions / lifecycle.js View on Github external
return dispatch => {
      const { components } = renderProps;
      const locals = {
        dispatch,
        counterActionsCreator: this.actionsCreators.counter,
      };

      return trigger('defer', components, locals);
    };
  }
github dbow / futureplate / src / client.js View on Github external
match({routes, location}, (error, redirectLocation, props = {}) => {
    const {components, params} = props;
    if (window.data) {
      delete window.data;
    } else {
      trigger('fetch', components, {store, params});
    }
  });
});
github retaxJS / retax-seed / src / server / hydrateClient.js View on Github external
export async function getInitialState(
  components,
  { dispatch },
) {
  logger('getInitialState: Running prefetchers');

  try {
    await trigger('fetch', components, {
      dispatch,
    });
  } catch (e) {
    warning(false, e.message);
  } finally {
    logger('getInitialState: Done');
  }
}

redial

Universal data fetching and route lifecycle management for React etc.

MIT
Latest version published 8 years ago

Package Health Score

48 / 100
Full package analysis

Popular redial functions

Similar packages