function ActionsObservable(actionsSubject) { _classCallCheck(this, ActionsObservable); var _this = _possibleConstructorReturn(this, (ActionsObservable.__proto__ || Object.getPrototypeOf(ActionsObservable)).call(this )); _this.source = actionsSubject; return _this; }
...
throw new TypeError('You must provide a root Epic to createEpicMiddleware');
}
// even though we used default param, we need to merge the defaults
// inside the options object as well in case they declare only some
options = _extends({}, defaultOptions, options);
var input$ = new _Subject.Subject();
var action$ = options.adapter.input(new _ActionsObservable.ActionsObservable(input$));
var epic$ = new _Subject.Subject();
var store = void 0;
var epicMiddleware = function epicMiddleware(_store) {
store = _store;
return function (next) {
...
function combineEpics() { for (var _len = arguments.length, epics = Array(_len), _key = 0; _key < _len; _key++) { epics[_key] = arguments[_key]; } return function () { for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { args[_key2] = arguments[_key2]; } return _merge.merge.apply(undefined, _toConsumableArray(epics.map(function (epic) { var output$ = epic.apply(undefined, args); if (!output$) { throw new TypeError('combineEpics: one of the provided Epics "' + (epic.name || '<anonymous>') + '" does not return a stream . Double check you\'re not missing a return statement!'); } return output$; }))); }; }
n/a
function createEpicMiddleware(epic) { var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultOptions; if (typeof epic !== 'function') { throw new TypeError('You must provide a root Epic to createEpicMiddleware'); } // even though we used default param, we need to merge the defaults // inside the options object as well in case they declare only some options = _extends({}, defaultOptions, options); var input$ = new _Subject.Subject(); var action$ = options.adapter.input(new _ActionsObservable.ActionsObservable(input$)); var epic$ = new _Subject.Subject(); var store = void 0; var epicMiddleware = function epicMiddleware(_store) { store = _store; return function (next) { var _context; (_context = _map.map.call(epic$, function (epic) { var output$ = 'dependencies' in options ? epic(action$, store, options.dependencies) : epic(action$, store); if (!output$) { throw new TypeError('Your root Epic "' + (epic.name || '<anonymous>') + '" does not return a stream. Double check you\' re not missing a return statement!'); } return output$; }), _switchMap.switchMap).call(_context, function (output$) { return options.adapter.output(output$); }).subscribe(store.dispatch); // Setup initial root epic epic$.next(epic); return function (action) { var result = next(action); input$.next(action); return result; }; }; }; epicMiddleware.replaceEpic = function (epic) { // gives the previous root Epic a last chance // to do some clean up store.dispatch({ type: _EPIC_END.EPIC_END }); // switches to the new root Epic, synchronously terminating // the previous one epic$.next(epic); }; return epicMiddleware; }
n/a
function ActionsObservable(actionsSubject) { _classCallCheck(this, ActionsObservable); var _this = _possibleConstructorReturn(this, (ActionsObservable.__proto__ || Object.getPrototypeOf(ActionsObservable)).call(this )); _this.source = actionsSubject; return _this; }
...
throw new TypeError('You must provide a root Epic to createEpicMiddleware');
}
// even though we used default param, we need to merge the defaults
// inside the options object as well in case they declare only some
options = _extends({}, defaultOptions, options);
var input$ = new _Subject.Subject();
var action$ = options.adapter.input(new _ActionsObservable.ActionsObservable(input$));
var epic$ = new _Subject.Subject();
var store = void 0;
var epicMiddleware = function epicMiddleware(_store) {
store = _store;
return function (next) {
...
function combineEpics() { for (var _len = arguments.length, epics = Array(_len), _key = 0; _key < _len; _key++) { epics[_key] = arguments[_key]; } return function () { for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { args[_key2] = arguments[_key2]; } return _merge.merge.apply(undefined, _toConsumableArray(epics.map(function (epic) { var output$ = epic.apply(undefined, args); if (!output$) { throw new TypeError('combineEpics: one of the provided Epics "' + (epic.name || '<anonymous>') + '" does not return a stream . Double check you\'re not missing a return statement!'); } return output$; }))); }; }
n/a
function createEpicMiddleware(epic) { var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultOptions; if (typeof epic !== 'function') { throw new TypeError('You must provide a root Epic to createEpicMiddleware'); } // even though we used default param, we need to merge the defaults // inside the options object as well in case they declare only some options = _extends({}, defaultOptions, options); var input$ = new _Subject.Subject(); var action$ = options.adapter.input(new _ActionsObservable.ActionsObservable(input$)); var epic$ = new _Subject.Subject(); var store = void 0; var epicMiddleware = function epicMiddleware(_store) { store = _store; return function (next) { var _context; (_context = _map.map.call(epic$, function (epic) { var output$ = 'dependencies' in options ? epic(action$, store, options.dependencies) : epic(action$, store); if (!output$) { throw new TypeError('Your root Epic "' + (epic.name || '<anonymous>') + '" does not return a stream. Double check you\' re not missing a return statement!'); } return output$; }), _switchMap.switchMap).call(_context, function (output$) { return options.adapter.output(output$); }).subscribe(store.dispatch); // Setup initial root epic epic$.next(epic); return function (action) { var result = next(action); input$.next(action); return result; }; }; }; epicMiddleware.replaceEpic = function (epic) { // gives the previous root Epic a last chance // to do some clean up store.dispatch({ type: _EPIC_END.EPIC_END }); // switches to the new root Epic, synchronously terminating // the previous one epic$.next(epic); }; return epicMiddleware; }
n/a