react-global-state-hooks 1.0.23 → 1.0.25

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.
@@ -1,7 +1,24 @@
1
- export * from 'react-native-global-state-hooks';
2
1
  import { GlobalStore as GlobalStoreBase } from 'react-native-global-state-hooks';
3
- import { ActionCollectionConfig, GlobalStoreConfig, StateConfigCallbackParam, StateSetter } from './GlobalStore.types';
2
+ import { ActionCollectionConfig, ActionCollectionResult, GlobalStoreConfig, StateConfigCallbackParam, StateSetter } from './GlobalStore.types';
4
3
  export declare class GlobalStore<TState, TMetadata = null, TStateSetter extends ActionCollectionConfig<TState, TMetadata> | StateSetter<TState> | null = StateSetter<TState>> extends GlobalStoreBase<TState, TMetadata, TStateSetter> {
4
+ /**
5
+ * Returns a custom hook that allows to handle a global state
6
+ * @returns {[TState, TStateSetter, TMetadata]} - The state, the state setter or the actions map, the metadata
7
+ * */
8
+ getHook: () => () => [
9
+ TState,
10
+ TStateSetter extends StateSetter<TState> ? StateSetter<TState> : ActionCollectionResult<TState, TMetadata, TStateSetter>,
11
+ TMetadata
12
+ ];
13
+ /**
14
+ * Returns an array with the a function to get the state, the state setter or the actions map, and a function to get the metadata
15
+ * @returns {[() => TState, TStateSetter, () => TMetadata]} - The state getter, the state setter or the actions map, the metadata getter
16
+ * */
17
+ getHookDecoupled: () => [
18
+ () => TState,
19
+ TStateSetter extends StateSetter<TState> ? StateSetter<TState> : ActionCollectionResult<TState, TMetadata, TStateSetter>,
20
+ () => TMetadata
21
+ ];
5
22
  /**
6
23
  * additional configuration for the store
7
24
  * @template {TState} TState - The type of the state object
@@ -1 +1 @@
1
- {"version":3,"file":"GlobalStore.d.ts","sourceRoot":"","sources":["../src/GlobalStore.ts"],"names":[],"mappings":"AAAA,cAAc,iCAAiC,CAAC;AAIhD,OAAO,EAGL,WAAW,IAAI,eAAe,EAC/B,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EACL,sBAAsB,EACtB,i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MAAM,CAAC,CAAC;eAoB9D;CACH"}
@@ -2,7 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.GlobalStore = void 0;
4
4
  const tslib_1 = require("tslib");
5
- tslib_1.__exportStar(require("react-native-global-state-hooks"), exports);
6
5
  const react_dom_1 = tslib_1.__importDefault(require("react-dom"));
7
6
  const react_native_global_state_hooks_1 = require("react-native-global-state-hooks");
8
7
  class GlobalStore extends react_native_global_state_hooks_1.GlobalStore {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-global-state-hooks",
3
- "version": "1.0.23",
3
+ "version": "1.0.25",
4
4
  "description": "This is a package to easily handling global-state across your react components No-redux, No-context.",
5
5
  "main": "lib/GlobalStore.js",
6
6
  "files": [