bunja 0.0.11 → 0.0.12

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.
Files changed (3) hide show
  1. package/bunja.ts +1 -0
  2. package/package.json +1 -1
  3. package/react.ts +2 -2
package/bunja.ts CHANGED
@@ -62,6 +62,7 @@ export class BunjaStore {
62
62
  scopeInstanceMap.forEach((scope) => scope.sub());
63
63
  };
64
64
  },
65
+ deps: Array.from(scopeInstanceMap.values()).map(({ value }) => value),
65
66
  };
66
67
  }
67
68
  #getBunjaInstance(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bunja",
3
- "version": "0.0.11",
3
+ "version": "0.0.12",
4
4
  "description": "State Lifetime Manager",
5
5
  "main": "bunja.ts",
6
6
  "scripts": {},
package/react.ts CHANGED
@@ -27,8 +27,8 @@ const defaultReadScope: ReadScope = (scope) => {
27
27
 
28
28
  export function useBunja<T>(bunja: Bunja<T>, readScope = defaultReadScope): T {
29
29
  const store = useContext(BunjaStoreContext);
30
- const { value, mount } = store.get(bunja, readScope);
31
- useEffect(mount, []);
30
+ const { value, mount, deps } = store.get(bunja, readScope);
31
+ useEffect(mount, deps);
32
32
  return value;
33
33
  }
34
34