Closed fabienjuif closed 6 years ago
Largely inspired from redux-little-router
But without the react part in it And simplified
Same as redux-little-router
Same as redux-little-router.
Same logic as redux-little-router. Plus:
k-redux-factory
code
href
compiledHref
const routes = { '/': { code: 'main', '/login': { code: 'login' }, '/profile': { code: 'profile' }, '/search': { code: 'search' }, '/projects': { code: 'projects', public: true, '/:id': { code: 'project', '/setup': { code: 'setup' }, '/summary': { code: 'summary', public: undefined }, '/measures': { code: 'measures', public: false }, '/symptoms': { code: 'symptoms' }, '/diagnostics': { code: 'diagnostics' }, }, }, }, }
Va mettre public: true dans toutes les routes enfant de projects Sauf dans /measures et dans /summary
projects
/measures
/summary
Pouvoir définir un 404 pour chaque enfant Exemple:
const routes = { '/': { code: 'main', '/login': { code: 'login' }, '/profile': { code: 'profile' }, '/search': { code: 'search' }, '/projects': { code: 'projects', routeNotFound: 'projectNotFound', '/404': { code: 'projectNotFound', }, '/:id': { code: 'project', '/setup': { code: 'setup' }, '/summary': { code: 'summary' }, '/measures': { code: 'measures' }, '/symptoms': { code: 'symptoms' }, '/diagnostics': { code: 'diagnostics' }, }, }, }, }
Bien faire les appels historyAPI avant de mettre à jour le store
Largely inspired from redux-little-router
API
Route definition
Same as redux-little-router
Actions
Same as redux-little-router.
Moins prio
State / Reducer
Same logic as redux-little-router. Plus:
k-redux-factory
to store state.code
as the route keyhref
of a routecompiledHref
of a route, this is the compiled Regexp versionSelectors
Notes
Va mettre public: true dans toutes les routes enfant de
projects
Sauf dans/measures
et dans/summary
Pouvoir définir un 404 pour chaque enfant Exemple:
Bien faire les appels historyAPI avant de mettre à jour le store