You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/introduction/usage/with-base-implementation.md
+9-9Lines changed: 9 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,9 +2,9 @@
2
2
3
3
Another simplest usage is to work with [base implementation](/api/view-models/base-implementation) of the [`ViewModel` interface](/api/view-models/interface)
4
4
5
-
Steps:
5
+
Follow the steps:
6
6
7
-
1. Create your [`ViewModel`](/api/view-models/overview) class using [`ViewModelBase`](/api/view-models/base-implementation) (base implementation of [`ViewModel` package interface](/api/view-models/interface))
7
+
##### **1.** Create your [`ViewModel`](/api/view-models/overview) class using [`ViewModelBase`](/api/view-models/base-implementation) (base implementation of [`ViewModel` package interface](/api/view-models/interface))
Copy file name to clipboardExpand all lines: docs/introduction/usage/with-view-model-store.md
+6-7Lines changed: 6 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,29 +3,29 @@
3
3
View Model store allows you to get access to your view model instances from everywhere and give you more control of the creating view model instances.
4
4
Follow the simplest way of how to add view model store into your application:
5
5
6
-
1. Create a class implementing the [ViewModelStore interface](/api/view-model-store/interface) or use [basic library implementation (ViewModelStoreBase)](/api/view-model-store/base-implementation).
6
+
##### **1.** Create a class implementing the [ViewModelStore interface](/api/view-model-store/interface) or use [basic library implementation (ViewModelStoreBase)](/api/view-model-store/base-implementation).
2. Create instance of the [ViewModelStore](/api/view-model-store/overview)
14
+
##### **2.** Create instance of the [ViewModelStore](/api/view-model-store/overview)
15
15
16
16
```ts
17
17
const viewModelStore =newMyViewModelStore() // or new ViewModelStoreBase
18
18
```
19
19
20
-
3. Integrate with [React](https://react.dev/) using [`ViewModelsProvider`](/react/api/view-models-provider) somewhere in root of your application
20
+
##### **3.** Integrate with [React](https://react.dev/) using [`ViewModelsProvider`](/react/api/view-models-provider) somewhere in root of your application
21
21
22
22
```tsx
23
-
<ViewModelsProvidersvalue={viewModelStore}>
23
+
<ViewModelsProvidervalue={viewModelStore}>
24
24
...
25
-
</ViewModelsProviders>
25
+
</ViewModelsProvider>
26
26
```
27
27
28
-
4. Get access to `ViewModelStore` inside your `ViewModels`
28
+
##### **4.** Get access to `ViewModelStore` inside your `ViewModels`
29
29
30
30
```ts
31
31
import { ViewModelBase } from"mobx-view-model";
@@ -50,4 +50,3 @@ export class YourVM extends ViewModelBase {
[ViewModelStore](/api/view-model-store/interface) is very powerful thing which allows you to lookup and get access to your view model instances everywhere.
0 commit comments