https://github.com/nfour/tiny-mst-router
A tiny mobx-state-tree router
https://github.com/nfour/tiny-mst-router
mobx mobx-state-tree react router
Last synced: 2 months ago
JSON representation
A tiny mobx-state-tree router
- Host: GitHub
- URL: https://github.com/nfour/tiny-mst-router
- Owner: nfour
- License: mit
- Created: 2020-02-12T03:34:32.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2021-05-11T19:01:01.000Z (about 5 years ago)
- Last Synced: 2025-06-05T21:46:40.745Z (about 1 year ago)
- Topics: mobx, mobx-state-tree, react, router
- Language: TypeScript
- Homepage:
- Size: 8.79 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# Tiny Mobx State Tree Router
It's only [one file](./TinyMstRouter.ts). Based on [/alisd23/mst-react-router](https://github.com/alisd23/mst-react-router)
## Usage
```ts
import { TinyMstRouter } from 'tiny-mst-router';
const router = TinyMstRouter.create({})
router.push('/myroute')
// or add it to your root model
export const RootModel = types.model({
router: TinyMstRouter,
// ...
})
```
## Install
- Dont forget the peer dependencies.
- Requires `history@5`
```json
"peerDependencies": {
"mobx": ">=5",
"mobx-state-tree": ">=3",
"history": ">=5"
}
```
`yarn add tiny-mst-router mobx mobx-state-tree history@5`