@reactables/core 1.1.0-beta.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.
- package/dist/Helpers/combine.d.ts +3 -0
- package/dist/Helpers/index.d.ts +1 -0
- package/dist/index.js +17 -0
- package/package.json +1 -1
|
@@ -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>)[];
|
package/dist/Helpers/index.d.ts
CHANGED
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