@dr.pogodin/react-global-state 0.15.0 → 0.16.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.
@@ -99,6 +99,14 @@ function useGlobalState<
99
99
  function useGlobalState<StateT>(): UseGlobalStateResT<StateT>;
100
100
 
101
101
  // "State evaluation overload"
102
+ function useGlobalState<
103
+ StateT,
104
+ PathT extends null | string | undefined,
105
+ >(
106
+ path: PathT,
107
+ initialValue: ValueOrInitializerT<Exclude<ValueAtPathT<StateT, PathT, never>, undefined>>
108
+ ): UseGlobalStateResT<Exclude<ValueAtPathT<StateT, PathT, void>, undefined>>;
109
+
102
110
  function useGlobalState<
103
111
  StateT,
104
112
  PathT extends null | string | undefined,
@@ -193,6 +201,11 @@ export default useGlobalState;
193
201
  export interface UseGlobalStateI<StateT> {
194
202
  (): UseGlobalStateResT<StateT>;
195
203
 
204
+ <PathT extends null | string | undefined>(
205
+ path: PathT,
206
+ initialValue: ValueOrInitializerT<Exclude<ValueAtPathT<StateT, PathT, never>, undefined>>
207
+ ): UseGlobalStateResT<Exclude<ValueAtPathT<StateT, PathT, void>, undefined>>;
208
+
196
209
  <PathT extends null | string | undefined>(
197
210
  path: PathT,
198
211
  initialValue?: ValueOrInitializerT<ValueAtPathT<StateT, PathT, never>>
package/tsconfig.json CHANGED
@@ -5,11 +5,11 @@
5
5
  "jsx": "react-jsx",
6
6
  "module": "ESNext",
7
7
  "moduleResolution": "Node",
8
+ "noUncheckedIndexedAccess": true,
8
9
  "outDir": "build",
9
10
  "paths": {
10
- "*": ["./*"],
11
+ "*": ["./*"]
11
12
  },
12
- "strict": true,
13
- "verbatimModuleSyntax": true,
14
- },
13
+ "verbatimModuleSyntax": true
14
+ }
15
15
  }