@lomray/react-mobx-manager 4.3.0-beta.1 → 4.3.0-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
  <img src="./logo.png" alt="Mobx stores manager logo" width="250" height="253">
5
5
  </p>
6
6
 
7
- MobX store manager for React with relative, parent and global stores.
7
+ Clean React components. Encapsulated business logic. No state-tree pain.
8
8
 
9
9
  It is built for apps that want explicit store ownership, SSR support, persistence, lifecycle cleanup and development tooling without forcing everything into one global state tree.
10
10
 
@@ -26,6 +26,19 @@ It is built for apps that want explicit store ownership, SSR support, persistenc
26
26
  - Best-effort HMR
27
27
  - And many other nice things 😎
28
28
 
29
+ <p align="center">
30
+ <img src="https://sonarcloud.io/api/project_badges/measure?project=Lomray-Software_react-mobx-manager&metric=reliability_rating" alt="reliability">
31
+ <img src="https://sonarcloud.io/api/project_badges/measure?project=Lomray-Software_react-mobx-manager&metric=security_rating" alt="Security Rating">
32
+ <img src="https://sonarcloud.io/api/project_badges/measure?project=Lomray-Software_react-mobx-manager&metric=sqale_rating" alt="Maintainability Rating">
33
+ <img src="https://sonarcloud.io/api/project_badges/measure?project=Lomray-Software_react-mobx-manager&metric=vulnerabilities" alt="Vulnerabilities">
34
+ <img src="https://sonarcloud.io/api/project_badges/measure?project=Lomray-Software_react-mobx-manager&metric=bugs" alt="Bugs">
35
+ <img src="https://sonarcloud.io/api/project_badges/measure?project=Lomray-Software_react-mobx-manager&metric=ncloc" alt="Lines of Code">
36
+ <img src="https://sonarcloud.io/api/project_badges/measure?project=Lomray-Software_react-mobx-manager&metric=coverage" alt="code coverage">
37
+ <img src="https://img.shields.io/bundlephobia/minzip/@lomray/react-mobx-manager" alt="size">
38
+ <img src="https://img.shields.io/npm/l/@lomray/react-mobx-manager" alt="size">
39
+ <img src="https://img.shields.io/npm/v/@lomray/react-mobx-manager?label=semantic%20release&logo=semantic-release" alt="semantic version">
40
+ </p>
41
+
29
42
  ## Install
30
43
 
31
44
  ```bash
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lomray/react-mobx-manager",
3
- "version": "4.3.0-beta.1",
3
+ "version": "4.3.0-beta.3",
4
4
  "description": "This package provides Mobx stores manager for react.",
5
5
  "type": "module",
6
6
  "main": "index.js",
package/parent-store.d.ts CHANGED
@@ -1,9 +1,8 @@
1
- import { IConstructableStore, TAnyStore } from "./types.js";
1
+ import { IConstructableStore, IStoreConfig } from "./types.js";
2
2
  /**
3
3
  * Mark store definition as parent store
4
4
  */
5
- declare const parentStore: <TSto extends TAnyStore>(store: IConstructableStore<TSto>) => {
6
- store: IConstructableStore<TSto>;
7
- isParent: true;
8
- };
5
+ declare const parentStore: <TStore extends IConstructableStore<import("./types.js").IStore>>(store: TStore) => {
6
+ store: TStore;
7
+ } & IStoreConfig;
9
8
  export { parentStore as default };
@@ -1 +1 @@
1
- {"version":3,"file":"parent-store.js","sources":["../src/parent-store.ts"],"sourcesContent":["import type { IConstructableStore, TAnyStore } from './types';\n\n/**\n * Mark store definition as parent store\n */\nconst parentStore = <TSto extends TAnyStore>(store: IConstructableStore<TSto>) => ({\n store,\n isParent: true as const,\n});\n\nexport default parentStore;\n"],"names":["parentStore","store","isParent"],"mappings":"AAKA,MAAMA,EAAuCC,IAAgC,CAC3EA,QACAC,UAAU"}
1
+ {"version":3,"file":"parent-store.js","sources":["../src/parent-store.ts"],"sourcesContent":["import type { IConstructableStore, IStoreConfig } from './types';\n\n/**\n * Mark store definition as parent store\n */\nconst parentStore = <TStore extends IConstructableStore>(\n store: TStore,\n): { store: TStore } & IStoreConfig => ({\n store,\n isParent: true as const,\n});\n\nexport default parentStore;\n"],"names":["parentStore","store","isParent"],"mappings":"AAKA,MAAMA,EACJC,IAAa,CAEbA,QACAC,UAAU"}
package/types.d.ts CHANGED
@@ -34,6 +34,10 @@ interface IStore extends IStoreLifecycle {
34
34
  isGlobal?: boolean;
35
35
  toJSON?: () => Record<string, any>;
36
36
  }
37
+ interface IRelativeStore extends IStore {
38
+ }
39
+ interface IGlobalStore extends IStore {
40
+ }
37
41
  interface IStorePersisted extends IStore {
38
42
  libStorageOptions?: IPersistOptions;
39
43
  addOnChangeListener?: (store: IStorePersisted, manager: Manager) => (() => void) | undefined;
@@ -85,7 +89,7 @@ interface IManagerOptions {
85
89
  */
86
90
  failedCreationStrategy?: 'none' | 'dummy' | 'empty';
87
91
  }
88
- type TAnyStore = IStore | IStorePersisted;
92
+ type TAnyStore = IStore | IRelativeStore | IGlobalStore | IStorePersisted;
89
93
  type TStores = {
90
94
  [storeKey: string]: TAnyStore;
91
95
  };
@@ -140,4 +144,4 @@ interface IPersistOptions {
140
144
  };
141
145
  isNotExported?: boolean;
142
146
  }
143
- export { IWindowManager, IConstructorParams, IStoreLifecycle, IStore, IStorePersisted, TInitStore, IConstructableStore, IStoreConfig, TStoreDefinition, TMapStores, IManagerParams, TWakeup, IStorage, IManagerOptions, TAnyStore, TStores, ClassReturnType, StoresType, IStoreParams, IWithStoreOptions, IMobxManagerEvents, IGroupedStores, IPersistOptions };
147
+ export { IWindowManager, IConstructorParams, IStoreLifecycle, IStore, IRelativeStore, IGlobalStore, IStorePersisted, TInitStore, IConstructableStore, IStoreConfig, TStoreDefinition, TMapStores, IManagerParams, TWakeup, IStorage, IManagerOptions, TAnyStore, TStores, ClassReturnType, StoresType, IStoreParams, IWithStoreOptions, IMobxManagerEvents, IGroupedStores, IPersistOptions };