https://github.com/vlazh/mobx-utils
Base classes and utilities of mobx stores and validable mobx models.
https://github.com/vlazh/mobx-utils
hooks javascript mobx mobx-react mobx-utils react typescript utils
Last synced: 2 months ago
JSON representation
Base classes and utilities of mobx stores and validable mobx models.
- Host: GitHub
- URL: https://github.com/vlazh/mobx-utils
- Owner: vlazh
- License: mit
- Created: 2018-10-01T17:25:53.000Z (over 6 years ago)
- Default Branch: main
- Last Pushed: 2025-03-19T05:49:40.000Z (3 months ago)
- Last Synced: 2025-03-29T17:41:29.509Z (3 months ago)
- Topics: hooks, javascript, mobx, mobx-react, mobx-utils, react, typescript, utils
- Language: TypeScript
- Homepage:
- Size: 796 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# MobX Utils
[](https://www.npmjs.org/package/@js-toolkit/mobx-utils)
Useful utils for mobx.
```ts
import { observable } from 'mobx';
import { attachSelectors, createRootStore, createStore } from '@js-toolkit/mobx-utils/store/object';const rootStore0 = createRootStore({
store1: createStore(
{
prop1: 0,
prop2: 0,
prop3: [],
prop4: '',
method: () => {},
},
{
prop3: observable.shallow,
prop4: false,
}
),
});const rootStore = attachSelectors(rootStore0, {
get isProp1(): boolean {
return root.store1.prop1 > 0;
},
});
```