Skip to content

Commit 5371f9b

Browse files
committed
docs: add docs for mobx-view-model-vite-plugin
1 parent bf8b5e9 commit 5371f9b

File tree

4 files changed

+58
-7
lines changed

4 files changed

+58
-7
lines changed

.changeset/stale-times-walk.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"mobx-view-model": patch
3+
---
4+
5+
added documentation about view plugin (`mobx-view-model-vite-plugin`)

docs/.vitepress/config.mts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ export default defineConfig({
199199
items: [
200200
{ text: 'Project examples', link: '/other/project-examples' },
201201
{ text: 'Dependent packages', link: '/other/dependent-packages' },
202-
// { text: 'Vite plugin for better HMR', link: '/other/dependent-packages' },
202+
{ text: 'Vite plugin', link: '/other/vite-plugin' },
203203
],
204204
}
205205
],

docs/other/dependent-packages.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,19 @@ List of dependent `NPM` packages, libraries which based on this package or using
44

55
## mobx-wouter
66

7-
It is a library for integration `Wouter` with `MobX`
8-
[GitHub url](https://github.com/js2me/mobx-wouter)
7+
`MobX` integration with `Wouter`
8+
9+
[**GitHub**](https://github.com/js2me/mobx-wouter)
910

1011
## mobx-route
1112

12-
It is a library for client-side routing on `MobX`
13-
[GitHub url](https://github.com/js2me/mobx-route)
13+
`MobX` client-side routing
14+
15+
[**GitHub**](https://github.com/js2me/mobx-route)
1416

1517
## mobx-react-routing
1618

17-
It is a library for integration `react-router-dom` (6 version) with `MobX`
18-
[GitHub url](https://github.com/js2me/mobx-react-routing)
19+
`MobX` integration with `react-router-dom`
20+
21+
[**GitHub**](https://github.com/js2me/mobx-react-routing)
1922

docs/other/vite-plugin.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Vite plugin
2+
This library has a `Vite` plugin that **can** improve DX when using the library.
3+
4+
5+
## Installation
6+
7+
::: code-group
8+
9+
```bash [npm]
10+
npm install mobx-view-model-vite-plugin
11+
```
12+
13+
```bash [yarn]
14+
yarn add mobx-view-model-vite-plugin
15+
```
16+
17+
```bash [pnpm]
18+
pnpm add mobx-view-model-vite-plugin
19+
```
20+
21+
:::
22+
23+
24+
## Usage
25+
26+
Open your `vite.config.ts` and add this plugin
27+
28+
```ts{1,4-6}
29+
import { mobxViewModel } from "mobx-view-model-vite-plugin";
30+
...
31+
plugins: [
32+
mobxViewModel({
33+
reloadOnChangeViewModel: true
34+
})
35+
]
36+
...
37+
```
38+
39+
## Features
40+
41+
### `reloadOnChangeViewModel`
42+
43+
This option enables reload page after your `ViewModel` change

0 commit comments

Comments
 (0)