How to use the found/lib/ResolverUtils.accumulateRouteValues function in found

To help you get started, we’ve selected a few found 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 relay-tools / found-relay / src / classic / Resolver.js View on Github external
getRouteParams(match, routeMatches) {
    return accumulateRouteValues(
      routeMatches,
      match.routeIndices,
      (params, routeMatch) => {
        const { route, routeParams } = routeMatch;

        // We need to always run this to make sure we don't miss route params.
        let nextParams = { ...params, ...routeParams };
        if (route.prepareParams) {
          nextParams = route.prepareParams(nextParams, routeMatch);
        }

        return nextParams;
      },
      null,
    );
  }
github relay-tools / found-relay / src / Resolver.js View on Github external
getRouteVariables(match, routeMatches) {
    return accumulateRouteValues(
      routeMatches,
      match.routeIndices,
      (variables, routeMatch) => {
        const { route, routeParams } = routeMatch;

        // We need to always run this to make sure we don't miss route params.
        let nextVariables = { ...variables, ...routeParams };
        if (route.prepareVariables) {
          nextVariables = route.prepareVariables(nextVariables, routeMatch);
        }

        return nextVariables;
      },
      null,
    );
  }