Effector-Router
Manage routing state with ease!
Provides convinient API on top of effector
state-manager.
Feautures:
- Nested routes
- Exact matches
- Named Parameters
- Unnamed Parameters
- Parameters modifiers
- Custom Parameters matching
- Implicit router included
Roadmap:
- 404
- SSR Tests
API
Route
type Route = : UnregisterCallback : string match matcher normalizedPath // + nested routes keys
createRouter(history?: History) => Router
This method creates router - root abstraction on routing. It provides API for history management, and reacting on history change events. It's fully optional, to explicitly define router!
const router = ; const route = router; // => Store<{match: boolean; params: {}}> route; router; // => {match: true, params: {id: 123}}
createRoutes(schema: RoutesSchema, router?: Router) => RoutesObject
const router = ; const routes = ; const unwatchProducts = routesproducts; router // => `/products/12` // => {matched: false, params: {}} router // => `/products/` // => {matched: true, params: {}} ; const unwatchContacts = routescontacts; router