@reactables/core 0.8.0-alpha.2 → 1.0.0-beta.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/index.js +6 -6
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -187,10 +187,10 @@ var HubFactory = function (_a) {
|
|
|
187
187
|
var messages$ = rxjs.merge.apply(void 0, __spreadArray([inputStream$, mergedScopedEffects], genericEffects, false)).pipe(operators.share());
|
|
188
188
|
var store = function (_a) {
|
|
189
189
|
var reducer = _a.reducer, name = _a.name, debug = _a.debug, initialState = _a.initialState, _b = _a.storeValue, storeValue = _b === void 0 ? false : _b;
|
|
190
|
-
var debugName = "[
|
|
190
|
+
var debugName = "[RX NAME] ".concat(name || 'undefined', "\n");
|
|
191
191
|
var seedState = initialState !== undefined ? initialState : reducer();
|
|
192
192
|
var state$ = messages$.pipe(operators.tap(function (action) {
|
|
193
|
-
debug && console.log(debugName, '[
|
|
193
|
+
debug && console.log(debugName, '[ACTION]', action, '\n');
|
|
194
194
|
}), operators.scan(reducer, seedState), operators.startWith(null, seedState), operators.pairwise(), operators.tap(function (_a) {
|
|
195
195
|
var prevState = _a[0], newState = _a[1];
|
|
196
196
|
if (debug) {
|
|
@@ -206,20 +206,20 @@ var HubFactory = function (_a) {
|
|
|
206
206
|
}, {});
|
|
207
207
|
};
|
|
208
208
|
var difference = reduceDiff(jsonDiff(prevState, newState));
|
|
209
|
-
console.log(debugName, '[
|
|
209
|
+
console.log(debugName, '[DIFF]', Object.keys(difference).length ? difference : null, '\n', '[STATE]', newState, '\n');
|
|
210
210
|
}
|
|
211
211
|
catch (e) {
|
|
212
|
-
console.log('
|
|
212
|
+
console.log('[ERROR READING DIFF]', e, '\n', '[STATE]', newState);
|
|
213
213
|
}
|
|
214
214
|
}
|
|
215
215
|
else {
|
|
216
216
|
var hasDiff = prevState !== newState;
|
|
217
|
-
console.log(debugName, '[
|
|
217
|
+
console.log(debugName, '[DIFF]', hasDiff
|
|
218
218
|
? {
|
|
219
219
|
oldValue: prevState,
|
|
220
220
|
newValue: newState
|
|
221
221
|
}
|
|
222
|
-
: null, '[
|
|
222
|
+
: null, '\n', '[STATE]', newState);
|
|
223
223
|
}
|
|
224
224
|
}
|
|
225
225
|
}), operators.map(function (pair) { return pair[1]; }));
|
package/package.json
CHANGED