Methods
-
addConfig(getAliases, scope)
-
Add aliases to the configuration
Parameters:
Name Type Default Description getAliasesfunction A callback that retrieves the aliases configuration. This function will only be called once the user navigates to a path that falls within the scope of this configuration. The function will receive the parameters that the page renderer passes to the
injectParamsparameter of thehandleRequestmethod. This function should return an object or a Promise that resolves with an object of the following shape:[ { from: 'from path', to: 'to path' }, { from: 'from path', to: 'to path' }, ... ]scopestring / The paths that are included in this config. Once the user navigates to a path that starts with this string, the
getAliasescallback will be called to load the aliases configuration.- Source:
-
<async> handleRequest(path, injectParams)
-
Resolves aliases for the given path. Will load in any configuration added with addConfig, if they had not been loaded already.
Parameters:
Name Type Description pathstring The requested path
injectParamsObject The parameters that will be injected to the getAliases callback of the configs. These should contain the redux store dispatch and getState.
- Source:
Returns:
A promise that resolves with the path that should be redirected to, or
falseif no matching aliases have been found.- Type
- Promise.<(boolean|string)>