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
P.S not required entity for targeted usage of this package, but can be helpful for accessing view models from everywhere by view model id or view model class name.
Hook that helps to get access to your view model in **React**.
16
+
Possible usage:
17
+
- `useViewModel<YourViewModel>()` - using generic to define type of returning view model instance
18
+
- `useViewModel<YourViewModel>(id)` - using `id` to define specific identifier of returning view model instance and generic for the same as above usage
Required for usage HOC that connects your `ViewModel` class with `View` (**React** Component)
23
+
Possible usage:
24
+
- `withViewModel(ViewModel)(View)` - simple usage
25
+
- `withViewModel(ViewModel, { factory })(View)` - advanced usage that needed to create your own implementations of `withViewModel` HOC, `ViewModelStore` and `ViewModel` classes.Example below:
26
+
```tsx
27
+
withViewModel(ViewModel, {
28
+
factory: (config) => {
29
+
// also you can achieve this your view model store implementation
0 commit comments