How to use the use-query-params.useQueryParams function in use-query-params

To help you get started, we’ve selected a few use-query-params 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 hotosm / tasking-manager / frontend / src / hooks / UseInboxQueryAPI.js View on Github external
export const useInboxQueryParams = () => {
  const uqp = useQueryParams(inboxQueryAllSpecification);

  /* TODO: refactor this larger fn to do useCallback or useMemo, below probably really expensive */
  const [qpValue, setQ] = uqp;
  if (qpValue && qpValue.page === undefined) {
    setQ({
      pageSize: 10,
      page: 1,
      orderBy: 'date',
      orderByType: 'desc'
    })
  }

  return uqp;
};
github hotosm / tasking-manager / frontend / src / hooks / UseTaskContributionAPI.js View on Github external
export const useTaskContributionQueryParams = () => {
  const uqp = useQueryParams(contributionsQueryAllSpecification);
  return uqp;
};
github hotosm / tasking-manager / frontend / src / hooks / UseProjectsQueryAPI.js View on Github external
export const useExploreProjectsQueryParams = () => {
  return useQueryParams(projectQueryAllSpecification);
};