@t8/react-store 1.2.2 → 1.2.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/dist/index.js CHANGED
@@ -121,7 +121,8 @@ var PersistentStore = class extends Store {
121
121
  // src/useStore.ts
122
122
  import { useEffect, useMemo, useRef, useState } from "react";
123
123
  function useStore(store, shouldUpdate = true) {
124
- if (!isStore(store)) throw new Error("'store' is not an instance of Store");
124
+ if (!isStore(store))
125
+ throw new Error("'store' is not an instance of Store");
125
126
  let [, setRevision] = useState(-1);
126
127
  let state = store.getState();
127
128
  let setState = useMemo(() => store.setState.bind(store), [store]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@t8/react-store",
3
- "version": "1.2.2",
3
+ "version": "1.2.3",
4
4
  "description": "Small React app state management lib aligned with React's state pattern, condensed to the essentials",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/src/useStore.ts CHANGED
@@ -36,7 +36,8 @@ export function useStore<T>(
36
36
  store: Store<T>,
37
37
  shouldUpdate: ShouldUpdate<T> = true,
38
38
  ): [T, SetStoreState<T>] {
39
- if (!isStore(store)) throw new Error("'store' is not an instance of Store");
39
+ if (!isStore<T>(store))
40
+ throw new Error("'store' is not an instance of Store");
40
41
 
41
42
  let [, setRevision] = useState(-1);
42
43