@reactables/core 0.7.0-alpha.9 → 0.7.1-alpha.2

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.
@@ -1 +1,2 @@
1
- export { RxBuilder, EffectsAndSources } from './RxBuilder';
1
+ export { RxBuilder, EffectsAndSources, RxConfig } from './RxBuilder';
2
+ export { Cases } from './createSlice';
package/dist/index.js CHANGED
@@ -63,12 +63,12 @@ var addEffects = function (actionCreator, scopedEffects) {
63
63
  };
64
64
 
65
65
  var createSlice = function (config) {
66
- var name = config.name, initialState = config.initialState, reducers = config.reducers;
66
+ var initialState = config.initialState, reducers = config.reducers;
67
67
  var reducer = Object.entries(reducers).reduce(function (acc, _a) {
68
68
  var key = _a[0], _case = _a[1];
69
69
  var _reducer = typeof _case === 'function' ? _case : _case.reducer;
70
70
  var newFunc = function (state, action) {
71
- if (action && action.type === "".concat(name ? "".concat(name, "/") : '').concat(key)) {
71
+ if (action && action.type === key) {
72
72
  return _reducer(state, action);
73
73
  }
74
74
  return acc(state, action);
@@ -81,7 +81,7 @@ var createSlice = function (config) {
81
81
  var actions = Object.entries(reducers).reduce(function (acc, _a) {
82
82
  var key = _a[0], _case = _a[1];
83
83
  acc[key] = function (payload) { return ({
84
- type: "".concat(name ? "".concat(name, "/") : '').concat(key),
84
+ type: key,
85
85
  payload: payload
86
86
  }); };
87
87
  if (typeof _case !== 'function' && _case.effects) {
@@ -133,7 +133,7 @@ var HubFactory = function (_a) {
133
133
  var messages$ = rxjs.merge.apply(void 0, __spreadArray([inputStream$, mergedScopedEffects], genericEffects, false)).pipe(operators.share());
134
134
  var store = function (_a) {
135
135
  var reducer = _a.reducer, name = _a.name, debug = _a.debug, initialState = _a.initialState, _b = _a.storeValue, storeValue = _b === void 0 ? false : _b;
136
- var debugName = "[Stream Name] ".concat(name || 'undefined');
136
+ var debugName = "[Rx Name] ".concat(name || 'undefined', " - ");
137
137
  var seedState = initialState !== undefined ? initialState : reducer();
138
138
  var state$ = messages$.pipe(operators.tap(function (action) {
139
139
  debug && console.log(debugName, '[Message Received]', action);
@@ -151,7 +151,11 @@ var HubFactory = function (_a) {
151
151
  }), operators.map(function (pair) { return pair[1]; }));
152
152
  if (storeValue) {
153
153
  var replaySubject_1 = new rxjs.ReplaySubject(1);
154
- state$.subscribe(function (state) { return replaySubject_1.next(state); });
154
+ state$
155
+ .pipe(operators.takeWhile(function () {
156
+ return !replaySubject_1.closed;
157
+ }))
158
+ .subscribe(function (state) { return replaySubject_1.next(state); });
155
159
  return replaySubject_1;
156
160
  }
157
161
  return state$;
@@ -172,7 +176,7 @@ var HubFactory = function (_a) {
172
176
  };
173
177
 
174
178
  var RxBuilder = function (_a) {
175
- var effects = _a.effects, _b = _a.sources, sources = _b === void 0 ? [] : _b, _c = _a.debug, debug = _c === void 0 ? false : _c, _d = _a.storeValue, storeValue = _d === void 0 ? false : _d, sliceConfig = __rest(_a, ["effects", "sources", "debug", "storeValue"]);
179
+ var effects = _a.effects, _b = _a.sources, sources = _b === void 0 ? [] : _b, _c = _a.debug, debug = _c === void 0 ? false : _c, _d = _a.storeValue, storeValue = _d === void 0 ? true : _d, sliceConfig = __rest(_a, ["effects", "sources", "debug", "storeValue"]);
176
180
  var _e = createSlice(sliceConfig), reducer = _e.reducer, actions = _e.actions;
177
181
  // Check sources and see if need to add effects
178
182
  if (!Array.isArray(sources)) {
package/package.json CHANGED
@@ -16,5 +16,5 @@
16
16
  "peerDependencies": {
17
17
  "rxjs": "^6.0.0 || ^7.0.0"
18
18
  },
19
- "version": "0.7.0-alpha.9"
19
+ "version": "0.7.1-alpha.2"
20
20
  }