@reactables/core 0.7.0-alpha.1 → 0.7.0-alpha.10

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.
Files changed (2) hide show
  1. package/dist/index.js +9 -6
  2. package/package.json +1 -1
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);
@@ -142,7 +142,7 @@ var HubFactory = function (_a) {
142
142
  if (debug) {
143
143
  var hasDiff = prevState !== newState;
144
144
  if (hasDiff) {
145
- console.log(debugName, '[State changed] Prev State:', prevState, 'New State:', newState);
145
+ console.log(debugName, '[State changed] State:', newState);
146
146
  }
147
147
  else {
148
148
  console.log(debugName, '[State unchanged] State:', newState);
@@ -203,7 +203,10 @@ var RxBuilder = function (_a) {
203
203
  },
204
204
  ];
205
205
  }));
206
- return [hub.store({ reducer: reducer, debug: debug, storeValue: storeValue }), actionsResult];
206
+ return [
207
+ hub.store({ reducer: reducer, debug: debug, storeValue: storeValue, name: sliceConfig.name }),
208
+ actionsResult,
209
+ ];
207
210
  };
208
211
 
209
212
  exports.RxBuilder = RxBuilder;
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.1"
19
+ "version": "0.7.0-alpha.10"
20
20
  }