enum Location { Route1, Route2, ... }
locator.GoTo(Location.Route1) locator.GoTo(Location.Route1, { foo: "bar" })
locator.Is(Location.Route1)
Make params class:
class SampleComponentLocatorParams { foo: string; bar: number; }
Inject LocatorParams<T>
, get params by:
_params.Params$.value.foo
Don't forget to subscribe to _params.Params$
.
_locator.SetParam('foo', 'new value')
- Bind Location with window title
- Load params to url at location entry
This repository has basic settings for buildling react application in Typescript.
The original source code of the provided example is here.
- React + ReactDOM (ver.16)
- Typescript (with TSLint setting)
- Prettier + tslint-config-prettier
- Test configuration using Jest + Enzyme
- Parcel bundler
npm run serve
Execute the command and you can run & test the application on localhost:1234
in the browser.
npm run build
The default output directory is /dist
.