chem-rx 0.0.6 → 0.0.7

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.cjs.js CHANGED
@@ -256,14 +256,17 @@ function useSelectAtom(atom, key) {
256
256
 
257
257
  function useHydrateAtoms(values) {
258
258
  react.useEffect(function () {
259
- for (var _iterator = _createForOfIteratorHelperLoose(values), _step; !(_step = _iterator()).done;) {
260
- var _step$value = _step.value,
261
- atom = _step$value[0],
262
- value = _step$value[1];
263
- atom._behavior$.next(value);
264
- }
259
+ hydrateAtoms(values);
265
260
  }, []);
266
261
  }
262
+ function hydrateAtoms(values) {
263
+ for (var _iterator = _createForOfIteratorHelperLoose(values), _step; !(_step = _iterator()).done;) {
264
+ var _step$value = _step.value,
265
+ atom = _step$value[0],
266
+ value = _step$value[1];
267
+ atom._behavior$.next(value);
268
+ }
269
+ }
267
270
 
268
271
  function Signal() {}
269
272
 
@@ -254,14 +254,17 @@ var chemicalRx = (function (exports, rxjs, react) {
254
254
 
255
255
  function useHydrateAtoms(values) {
256
256
  react.useEffect(function () {
257
- for (var _iterator = _createForOfIteratorHelperLoose(values), _step; !(_step = _iterator()).done;) {
258
- var _step$value = _step.value,
259
- atom = _step$value[0],
260
- value = _step$value[1];
261
- atom._behavior$.next(value);
262
- }
257
+ hydrateAtoms(values);
263
258
  }, []);
264
259
  }
260
+ function hydrateAtoms(values) {
261
+ for (var _iterator = _createForOfIteratorHelperLoose(values), _step; !(_step = _iterator()).done;) {
262
+ var _step$value = _step.value,
263
+ atom = _step$value[0],
264
+ value = _step$value[1];
265
+ atom._behavior$.next(value);
266
+ }
267
+ }
265
268
 
266
269
  function Signal() {}
267
270
 
package/dist/index.js CHANGED
@@ -178,11 +178,14 @@ function useSelectAtom(atom, key) {
178
178
 
179
179
  function useHydrateAtoms(values) {
180
180
  useEffect(() => {
181
- for (const [atom, value] of values) {
182
- atom._behavior$.next(value);
183
- }
181
+ hydrateAtoms(values);
184
182
  }, []);
185
183
  }
184
+ function hydrateAtoms(values) {
185
+ for (const [atom, value] of values) {
186
+ atom._behavior$.next(value);
187
+ }
188
+ }
186
189
 
187
190
  function Signal() {}
188
191
 
@@ -1,3 +1,4 @@
1
1
  import { BaseAtom } from "./Atom";
2
2
  export declare function useHydrateAtoms(values: readonly [BaseAtom<any>, any][]): void;
3
+ export declare function hydrateAtoms(values: readonly [BaseAtom<any>, any][]): void;
3
4
  //# sourceMappingURL=useHydrateAtoms.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useHydrateAtoms.d.ts","sourceRoot":"","sources":["../src/useHydrateAtoms.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAElC,wBAAgB,eAAe,CAAC,MAAM,EAAE,SAAS,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC,EAAE,QAMtE"}
1
+ {"version":3,"file":"useHydrateAtoms.d.ts","sourceRoot":"","sources":["../src/useHydrateAtoms.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAElC,wBAAgB,eAAe,CAAC,MAAM,EAAE,SAAS,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC,EAAE,QAItE;AAED,wBAAgB,YAAY,CAAC,MAAM,EAAE,SAAS,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC,EAAE,QAInE"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chem-rx",
3
- "version": "0.0.6",
3
+ "version": "0.0.7",
4
4
  "description": "react state primitives powered by rx.js",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -3,8 +3,12 @@ import { BaseAtom } from "./Atom";
3
3
 
4
4
  export function useHydrateAtoms(values: readonly [BaseAtom<any>, any][]) {
5
5
  useEffect(() => {
6
- for (const [atom, value] of values) {
7
- atom._behavior$.next(value);
8
- }
6
+ hydrateAtoms(values);
9
7
  }, []);
10
8
  }
9
+
10
+ export function hydrateAtoms(values: readonly [BaseAtom<any>, any][]) {
11
+ for (const [atom, value] of values) {
12
+ atom._behavior$.next(value);
13
+ }
14
+ }