How to use the found/lib/Matcher 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 catamphetamine / react-pages / source / router / index.js View on Github external
const middlewares = [
		queryMiddleware
	]
	if (options.basename) {
		middlewares.push(createBasenameMiddleware({
			basename: options.basename
		}))
	}
	return [
		createHistoryEnhancer({
			protocol: createHistoryProtocol(),
			middlewares
		}),
		createMatchEnhancer(
			// new Matcher(hotRouteConfig(routes))
			new Matcher(routes)
		)
	]
}
github jkettmann / universal-react-relay-starter-kit / client / store / index.js View on Github external
function generateStore(protocol) {
  const historyEnhancer = createHistoryEnhancer({
    protocol,
    middlewares: [queryMiddleware],
  })

  const matcherEnhancer = createMatchEnhancer(
    new Matcher(routeConfig),
  )

  const middleWare = composeEnhancers(
    historyEnhancer,
    matcherEnhancer,
  )

  const store = createStore(reducers, middleWare)

  store.dispatch(FarceActions.init())

  return store
}