react-native-global-state-hooks 5.0.15 → 6.0.0

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/package.json CHANGED
@@ -1,13 +1,14 @@
1
1
  {
2
2
  "name": "react-native-global-state-hooks",
3
- "version": "5.0.15",
4
- "description": "This is a package to easily handling global-state across your react-native-components No-redux",
3
+ "version": "6.0.0",
4
+ "description": "This is a package to easily handling global-state across your react-native-components No-redux... The library now includes @react-native-async-storage/async-storage to persist your state across sessions... if you want to keep using the old version without async-storage or react-native dependencies just use version 5.0.15 or user react-hooks-global-states instead",
5
5
  "main": "lib/bundle.js",
6
6
  "types": "lib/src/index.d.ts",
7
7
  "files": [
8
8
  "lib"
9
9
  ],
10
10
  "scripts": {
11
+ "test:debug2": "open -a \"Google Chrome\" chrome://inspect && node --nolazy --inspect-brk ./node_modules/jest/bin/jest.js --runInBand --colors --verbose",
11
12
  "test:debug": "node --inspect-brk node_modules/.bin/jest --watch --runInBand",
12
13
  "test:quick": "jest --maxWorkers=4 -c --no-watchman -u",
13
14
  "test:coverage": "jest --maxWorkers=4 -c --colors --no-watchman --verbose --coverage",
@@ -42,11 +43,13 @@
42
43
  "homepage": "https://github.com/johnny-quesada-developer/react-native-global-state-hooks#readme",
43
44
  "devDependencies": {
44
45
  "@babel/core": "^7.21.3",
46
+ "@babel/plugin-proposal-export-namespace-from": "^7.18.9",
45
47
  "@babel/plugin-transform-modules-commonjs": "^7.21.2",
46
48
  "@babel/preset-env": "^7.20.2",
47
49
  "@babel/preset-react": "^7.18.6",
48
50
  "@babel/preset-typescript": "^7.21.0",
49
- "@types/jest": "^26.0.17",
51
+ "@react-native-async-storage/async-storage": ">=1.17.11",
52
+ "@types/jest": "^29.5.11",
50
53
  "@types/lodash": "^4.14.165",
51
54
  "@types/react": "^17.0.0",
52
55
  "@types/react-dom": "^17.0.0",
@@ -62,10 +65,11 @@
62
65
  "eslint-plugin-jsx-a11y": "^6.4.1",
63
66
  "eslint-plugin-react": "^7.21.5",
64
67
  "eslint-plugin-react-hooks": "^4.2.0",
65
- "jest": "^26.6.3",
66
- "react": ">=17.0.0",
68
+ "jest": "^29.7.0",
69
+ "react": "^17.0.0",
70
+ "react-native": ">=0.71.6",
67
71
  "react-test-renderer": "^17.0.1",
68
- "ts-jest": "^26.4.4",
72
+ "ts-jest": "^29.1.1",
69
73
  "ts-loader": "^9.4.2",
70
74
  "tslib": "^2.5.0",
71
75
  "typescript": "^4.9.5",
@@ -73,14 +77,22 @@
73
77
  "webpack-cli": "^5.0.1"
74
78
  },
75
79
  "peerDependencies": {
76
- "react": ">=17.0.0"
80
+ "@react-native-async-storage/async-storage": ">=1.17.11",
81
+ "react": ">=17.0.0",
82
+ "react-native": ">=0.71.6"
77
83
  },
78
84
  "peerDependenciesMeta": {
79
85
  "react": {
80
86
  "optional": false
87
+ },
88
+ "react-native": {
89
+ "optional": false
90
+ },
91
+ "@react-native-async-storage/async-storage": {
92
+ "optional": false
81
93
  }
82
94
  },
83
95
  "dependencies": {
84
- "json-storage-formatter": "^1.0.8"
96
+ "react-hooks-global-states": "^1.0.0"
85
97
  }
86
98
  }
@@ -1,27 +0,0 @@
1
- import { StateGetter, UnsubscribeCallback, SelectorCallback, UseHookConfig, SubscribeToEmitter, StateHook } from "./GlobalStore.types";
2
- /**
3
- * @description
4
- * This function allows you to create a derivate state by merging the state of multiple hooks.
5
- * The update of the derivate state is debounced to avoid unnecessary re-renders.
6
- * By default, the debounce delay is 0, but you can change it by passing a delay in milliseconds as the third parameter.
7
- * @returns a tuple with the following elements: [subscribe, getState, dispose]
8
- */
9
- export declare const combineAsyncGettersEmitter: <TDerivate, TArguments extends StateGetter<unknown>[], TResults = { [K in keyof TArguments]: TArguments[K] extends () => infer TResult ? Exclude<TResult, UnsubscribeCallback> : never; }>(parameters: {
10
- selector: SelectorCallback<TResults, TDerivate>;
11
- config?: UseHookConfig<TDerivate> & {
12
- delay?: number;
13
- };
14
- }, ...args: TArguments) => [subscribe: SubscribeToEmitter<TDerivate>, getState: StateGetter<TDerivate>, dispose: UnsubscribeCallback];
15
- /**
16
- * @description
17
- * This function allows you to create a derivate state by merging the state of multiple hooks.
18
- * The update of the derivate state is debounced to avoid unnecessary re-renders.
19
- * By default, the debounce delay is 0, but you can change it by passing a delay in milliseconds as the third parameter.
20
- * @returns A tuple containing the subscribe function, the state getter and the dispose function
21
- */
22
- export declare const combineAsyncGetters: <TDerivate, TArguments extends StateGetter<unknown>[], TResults = { [K in keyof TArguments]: TArguments[K] extends () => infer TResult ? Exclude<TResult, UnsubscribeCallback> : never; }>(parameters: {
23
- selector: SelectorCallback<TResults, TDerivate>;
24
- config?: UseHookConfig<TDerivate> & {
25
- delay?: number;
26
- };
27
- }, ...args: TArguments) => [useHook: StateHook<TDerivate, null, null>, getState: StateGetter<TDerivate>, dispose: UnsubscribeCallback];