Repository URL to install this package:
|
Version:
7.0.0-alpha.3 ▾
|
@skava/router
/
src
|
|---|
| .. |
| __unused |
| deps |
| observable |
| react-router-config |
| Context.tsx |
| OneRouterProvider.tsx |
| OneRouterToRuleThemAll.ts |
| README.md |
| config.ts |
| index.ts |
| makeHistory.ts |
| oneRouter.ts |
| typings.ts |
@todo add observable update in link-view
/** * @api https://mobx.js.org/refguide/observe */ // observe(this, subscriber) // observe(this.store, subscriber) // if (this.observersList.includes(subscriber) === false) { // this.observersList.set(subscriber, true) // this.observersList.push(subscriber) // const subscribeToRouteChange = this.get('subscribe') // this.router && this.router.history && this.router.history.listen
// this.log(pathname, { routePathCurrent, matchedFromPath, pathname }) // const params = { ...matchedFromPath, ...matchedFromPath.params } // access to which route had the data // Object.defineProperty(matched, '@@matches', { // writable: false, // configurable: false, // enumerable: false, // value: matchedFromPath, // }) // react router always counts this as root // if (this.props && isObj(this.props.match)) { // // matched = { // // ...matched, // // ...this.props.match, // // ...this.props.match.params, // // } // Object.assign(matched, this.props.match.params) // } // else { // matched.match = matched // }
// check our local routes // otherwise goto // routePathsList.includes(to) // return this.router.goto(to)
get urlFromExpress(): OneUrl { return isObj(this.router) && isObj(this.router.location) ? this.location.full || '' : '' }