@reactables/core 1.1.0 → 1.2.0-alpha.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.
@@ -0,0 +1,3 @@
1
+ import { Observable } from 'rxjs';
2
+ import { Reactable } from '../Models';
3
+ export declare const combine: <T extends Record<string, Reactable<unknown, unknown>>>(reactablesDict: T) => ({ [K in keyof T]: T[K][1]; } | Observable<{ [K_2 in keyof T]: Observable<T[K_2][0]>; } extends infer T_1 extends Record<string, import("rxjs").ObservableInput<any>> ? { [K_1 in keyof T_1]: import("rxjs").ObservedValueOf<{ [K_2 in keyof T]: Observable<T[K_2][0]>; }[K_1]>; } : never>)[];
@@ -1,3 +1,4 @@
1
1
  export { RxBuilder, EffectsAndSources, RxConfig } from './RxBuilder';
2
2
  export { storeValue, DestroyAction } from './storeValue';
3
3
  export { Cases } from './createSlice';
4
+ export { combine } from './combine';
package/dist/index.js CHANGED
@@ -299,6 +299,23 @@ var storeValue = function (reactable) {
299
299
  return [replaySubject$, __assign(__assign({}, actions), { destroy: destroy }), actions$];
300
300
  };
301
301
 
302
+ var combine = function (reactablesDict) {
303
+ var _a = Object.entries(reactablesDict).reduce(function (acc, _a) {
304
+ var _b, _c;
305
+ var key = _a[0], _d = _a[1], state$ = _d[0], actions = _d[1];
306
+ return {
307
+ states: __assign(__assign({}, acc.states), (_b = {}, _b[key] = state$, _b)),
308
+ actions: __assign(__assign({}, acc.actions), (_c = {}, _c[key] = actions, _c))
309
+ };
310
+ }, {
311
+ states: {},
312
+ actions: {}
313
+ }), states = _a.states, actions = _a.actions;
314
+ var states$ = rxjs.combineLatest(states);
315
+ return [states$, actions];
316
+ };
317
+
302
318
  exports.RxBuilder = RxBuilder;
319
+ exports.combine = combine;
303
320
  exports.ofTypes = ofTypes;
304
321
  exports.storeValue = storeValue;
package/package.json CHANGED
@@ -16,5 +16,5 @@
16
16
  "peerDependencies": {
17
17
  "rxjs": "^6.0.0 || ^7.0.0"
18
18
  },
19
- "version": "1.1.0"
19
+ "version": "1.2.0-alpha.0"
20
20
  }