redux-saga
Advanced tools
Comparing version 0.16.0 to 0.16.1
@@ -716,158 +716,2 @@ (function (global, factory) { | ||
var done = { done: true, value: undefined }; | ||
var qEnd = {}; | ||
function safeName(patternOrChannel) { | ||
if (is.channel(patternOrChannel)) { | ||
return 'channel'; | ||
} else if (Array.isArray(patternOrChannel)) { | ||
return String(patternOrChannel.map(function (entry) { | ||
return String(entry); | ||
})); | ||
} else { | ||
return String(patternOrChannel); | ||
} | ||
} | ||
function fsmIterator(fsm, q0) { | ||
var name = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'iterator'; | ||
var updateState = void 0, | ||
qNext = q0; | ||
function next(arg, error) { | ||
if (qNext === qEnd) { | ||
return done; | ||
} | ||
if (error) { | ||
qNext = qEnd; | ||
throw error; | ||
} else { | ||
updateState && updateState(arg); | ||
var _fsm$qNext = fsm[qNext](), | ||
q = _fsm$qNext[0], | ||
output = _fsm$qNext[1], | ||
_updateState = _fsm$qNext[2]; | ||
qNext = q; | ||
updateState = _updateState; | ||
return qNext === qEnd ? done : output; | ||
} | ||
} | ||
return makeIterator(next, function (error) { | ||
return next(null, error); | ||
}, name, true); | ||
} | ||
function takeEvery$2(patternOrChannel, worker) { | ||
for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { | ||
args[_key - 2] = arguments[_key]; | ||
} | ||
var yTake = { done: false, value: take(patternOrChannel) }; | ||
var yFork = function yFork(ac) { | ||
return { done: false, value: fork.apply(undefined, [worker].concat(args, [ac])) }; | ||
}; | ||
var action = void 0, | ||
setAction = function setAction(ac) { | ||
return action = ac; | ||
}; | ||
return fsmIterator({ | ||
q1: function q1() { | ||
return ['q2', yTake, setAction]; | ||
}, | ||
q2: function q2() { | ||
return action === END ? [qEnd] : ['q1', yFork(action)]; | ||
} | ||
}, 'q1', 'takeEvery(' + safeName(patternOrChannel) + ', ' + worker.name + ')'); | ||
} | ||
function takeLatest$2(patternOrChannel, worker) { | ||
for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { | ||
args[_key - 2] = arguments[_key]; | ||
} | ||
var yTake = { done: false, value: take(patternOrChannel) }; | ||
var yFork = function yFork(ac) { | ||
return { done: false, value: fork.apply(undefined, [worker].concat(args, [ac])) }; | ||
}; | ||
var yCancel = function yCancel(task) { | ||
return { done: false, value: cancel(task) }; | ||
}; | ||
var task = void 0, | ||
action = void 0; | ||
var setTask = function setTask(t) { | ||
return task = t; | ||
}; | ||
var setAction = function setAction(ac) { | ||
return action = ac; | ||
}; | ||
return fsmIterator({ | ||
q1: function q1() { | ||
return ['q2', yTake, setAction]; | ||
}, | ||
q2: function q2() { | ||
return action === END ? [qEnd] : task ? ['q3', yCancel(task)] : ['q1', yFork(action), setTask]; | ||
}, | ||
q3: function q3() { | ||
return ['q1', yFork(action), setTask]; | ||
} | ||
}, 'q1', 'takeLatest(' + safeName(patternOrChannel) + ', ' + worker.name + ')'); | ||
} | ||
function throttle$2(delayLength, pattern, worker) { | ||
for (var _len = arguments.length, args = Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) { | ||
args[_key - 3] = arguments[_key]; | ||
} | ||
var action = void 0, | ||
channel$$1 = void 0; | ||
var yActionChannel = { done: false, value: actionChannel(pattern, buffers.sliding(1)) }; | ||
var yTake = function yTake() { | ||
return { done: false, value: take(channel$$1) }; | ||
}; | ||
var yFork = function yFork(ac) { | ||
return { done: false, value: fork.apply(undefined, [worker].concat(args, [ac])) }; | ||
}; | ||
var yDelay = { done: false, value: call(delay, delayLength) }; | ||
var setAction = function setAction(ac) { | ||
return action = ac; | ||
}; | ||
var setChannel = function setChannel(ch) { | ||
return channel$$1 = ch; | ||
}; | ||
return fsmIterator({ | ||
q1: function q1() { | ||
return ['q2', yActionChannel, setChannel]; | ||
}, | ||
q2: function q2() { | ||
return ['q3', yTake(), setAction]; | ||
}, | ||
q3: function q3() { | ||
return action === END ? [qEnd] : ['q4', yFork(action)]; | ||
}, | ||
q4: function q4() { | ||
return ['q2', yDelay]; | ||
} | ||
}, 'q1', 'throttle(' + safeName(pattern) + ', ' + worker.name + ')'); | ||
} | ||
var deprecationWarning = function deprecationWarning(helperName) { | ||
return 'import { ' + helperName + ' } from \'redux-saga\' has been deprecated in favor of import { ' + helperName + ' } from \'redux-saga/effects\'.\nThe latter will not work with yield*, as helper effects are wrapped automatically for you in fork effect.\nTherefore yield ' + helperName + ' will return task descriptor to your saga and execute next lines of code.'; | ||
}; | ||
var takeEvery$1 = /*#__PURE__*/deprecate(takeEvery$2, /*#__PURE__*/deprecationWarning('takeEvery')); | ||
var takeLatest$1 = /*#__PURE__*/deprecate(takeLatest$2, /*#__PURE__*/deprecationWarning('takeLatest')); | ||
var throttle$1 = /*#__PURE__*/deprecate(throttle$2, /*#__PURE__*/deprecationWarning('throttle')); | ||
var IO = /*#__PURE__*/sym('IO'); | ||
@@ -1094,26 +938,2 @@ var TAKE = 'TAKE'; | ||
function takeEvery(patternOrChannel, worker) { | ||
for (var _len8 = arguments.length, args = Array(_len8 > 2 ? _len8 - 2 : 0), _key8 = 2; _key8 < _len8; _key8++) { | ||
args[_key8 - 2] = arguments[_key8]; | ||
} | ||
return fork.apply(undefined, [takeEvery$2, patternOrChannel, worker].concat(args)); | ||
} | ||
function takeLatest(patternOrChannel, worker) { | ||
for (var _len9 = arguments.length, args = Array(_len9 > 2 ? _len9 - 2 : 0), _key9 = 2; _key9 < _len9; _key9++) { | ||
args[_key9 - 2] = arguments[_key9]; | ||
} | ||
return fork.apply(undefined, [takeLatest$2, patternOrChannel, worker].concat(args)); | ||
} | ||
function throttle(ms, pattern, worker) { | ||
for (var _len10 = arguments.length, args = Array(_len10 > 3 ? _len10 - 3 : 0), _key10 = 3; _key10 < _len10; _key10++) { | ||
args[_key10 - 3] = arguments[_key10]; | ||
} | ||
return fork.apply(undefined, [throttle$2, ms, pattern, worker].concat(args)); | ||
} | ||
var createAsEffectType = function createAsEffectType(type) { | ||
@@ -1876,3 +1696,3 @@ return function (effect) { | ||
} | ||
}, _ref9.cont = cont, _ref9.joiners = [], _ref9.cancel = cancel$$1, _ref9.isRunning = function isRunning() { | ||
}, _ref9.cont = cont, _ref9.joiners = [], _ref9.cancel = cancel, _ref9.isRunning = function isRunning() { | ||
return iterator._isRunning; | ||
@@ -1887,6 +1707,6 @@ }, _ref9.isCancelled = function isCancelled() { | ||
return iterator._error; | ||
}, _ref9.setContext = function setContext$$1(props) { | ||
}, _ref9.setContext = function setContext(props) { | ||
check(props, is.object, createSetContextWarning('task', props)); | ||
object.assign(taskContext, props); | ||
}, defineEnumerableProperties(_ref9, _mutatorMap), _ref9; | ||
}, babelHelpers.defineEnumerableProperties(_ref9, _mutatorMap), _ref9; | ||
} | ||
@@ -2023,4 +1843,184 @@ } | ||
var done = { done: true, value: undefined }; | ||
var qEnd = {}; | ||
function safeName(patternOrChannel) { | ||
if (is.channel(patternOrChannel)) { | ||
return 'channel'; | ||
} else if (Array.isArray(patternOrChannel)) { | ||
return String(patternOrChannel.map(function (entry) { | ||
return String(entry); | ||
})); | ||
} else { | ||
return String(patternOrChannel); | ||
} | ||
} | ||
function fsmIterator(fsm, q0) { | ||
var name = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'iterator'; | ||
var updateState = void 0, | ||
qNext = q0; | ||
function next(arg, error) { | ||
if (qNext === qEnd) { | ||
return done; | ||
} | ||
if (error) { | ||
qNext = qEnd; | ||
throw error; | ||
} else { | ||
updateState && updateState(arg); | ||
var _fsm$qNext = fsm[qNext](), | ||
q = _fsm$qNext[0], | ||
output = _fsm$qNext[1], | ||
_updateState = _fsm$qNext[2]; | ||
qNext = q; | ||
updateState = _updateState; | ||
return qNext === qEnd ? done : output; | ||
} | ||
} | ||
return makeIterator(next, function (error) { | ||
return next(null, error); | ||
}, name, true); | ||
} | ||
function takeEvery$1(patternOrChannel, worker) { | ||
for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { | ||
args[_key - 2] = arguments[_key]; | ||
} | ||
var yTake = { done: false, value: take(patternOrChannel) }; | ||
var yFork = function yFork(ac) { | ||
return { done: false, value: fork.apply(undefined, [worker].concat(args, [ac])) }; | ||
}; | ||
var action = void 0, | ||
setAction = function setAction(ac) { | ||
return action = ac; | ||
}; | ||
return fsmIterator({ | ||
q1: function q1() { | ||
return ['q2', yTake, setAction]; | ||
}, | ||
q2: function q2() { | ||
return action === END ? [qEnd] : ['q1', yFork(action)]; | ||
} | ||
}, 'q1', 'takeEvery(' + safeName(patternOrChannel) + ', ' + worker.name + ')'); | ||
} | ||
function takeLatest$1(patternOrChannel, worker) { | ||
for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { | ||
args[_key - 2] = arguments[_key]; | ||
} | ||
var yTake = { done: false, value: take(patternOrChannel) }; | ||
var yFork = function yFork(ac) { | ||
return { done: false, value: fork.apply(undefined, [worker].concat(args, [ac])) }; | ||
}; | ||
var yCancel = function yCancel(task) { | ||
return { done: false, value: cancel(task) }; | ||
}; | ||
var task = void 0, | ||
action = void 0; | ||
var setTask = function setTask(t) { | ||
return task = t; | ||
}; | ||
var setAction = function setAction(ac) { | ||
return action = ac; | ||
}; | ||
return fsmIterator({ | ||
q1: function q1() { | ||
return ['q2', yTake, setAction]; | ||
}, | ||
q2: function q2() { | ||
return action === END ? [qEnd] : task ? ['q3', yCancel(task)] : ['q1', yFork(action), setTask]; | ||
}, | ||
q3: function q3() { | ||
return ['q1', yFork(action), setTask]; | ||
} | ||
}, 'q1', 'takeLatest(' + safeName(patternOrChannel) + ', ' + worker.name + ')'); | ||
} | ||
function throttle$1(delayLength, pattern, worker) { | ||
for (var _len = arguments.length, args = Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) { | ||
args[_key - 3] = arguments[_key]; | ||
} | ||
var action = void 0, | ||
channel$$1 = void 0; | ||
var yActionChannel = { done: false, value: actionChannel(pattern, buffers.sliding(1)) }; | ||
var yTake = function yTake() { | ||
return { done: false, value: take(channel$$1) }; | ||
}; | ||
var yFork = function yFork(ac) { | ||
return { done: false, value: fork.apply(undefined, [worker].concat(args, [ac])) }; | ||
}; | ||
var yDelay = { done: false, value: call(delay, delayLength) }; | ||
var setAction = function setAction(ac) { | ||
return action = ac; | ||
}; | ||
var setChannel = function setChannel(ch) { | ||
return channel$$1 = ch; | ||
}; | ||
return fsmIterator({ | ||
q1: function q1() { | ||
return ['q2', yActionChannel, setChannel]; | ||
}, | ||
q2: function q2() { | ||
return ['q3', yTake(), setAction]; | ||
}, | ||
q3: function q3() { | ||
return action === END ? [qEnd] : ['q4', yFork(action)]; | ||
}, | ||
q4: function q4() { | ||
return ['q2', yDelay]; | ||
} | ||
}, 'q1', 'throttle(' + safeName(pattern) + ', ' + worker.name + ')'); | ||
} | ||
var deprecationWarning = function deprecationWarning(helperName) { | ||
return 'import { ' + helperName + ' } from \'redux-saga\' has been deprecated in favor of import { ' + helperName + ' } from \'redux-saga/effects\'.\nThe latter will not work with yield*, as helper effects are wrapped automatically for you in fork effect.\nTherefore yield ' + helperName + ' will return task descriptor to your saga and execute next lines of code.'; | ||
}; | ||
var takeEvery = /*#__PURE__*/deprecate(takeEvery$1, /*#__PURE__*/deprecationWarning('takeEvery')); | ||
var takeLatest = /*#__PURE__*/deprecate(takeLatest$1, /*#__PURE__*/deprecationWarning('takeLatest')); | ||
var throttle = /*#__PURE__*/deprecate(throttle$1, /*#__PURE__*/deprecationWarning('throttle')); | ||
function takeEvery$2(patternOrChannel, worker) { | ||
for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { | ||
args[_key - 2] = arguments[_key]; | ||
} | ||
return fork.apply(undefined, [takeEvery$1, patternOrChannel, worker].concat(args)); | ||
} | ||
function takeLatest$2(patternOrChannel, worker) { | ||
for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) { | ||
args[_key2 - 2] = arguments[_key2]; | ||
} | ||
return fork.apply(undefined, [takeLatest$1, patternOrChannel, worker].concat(args)); | ||
} | ||
function throttle$2(ms, pattern, worker) { | ||
for (var _len3 = arguments.length, args = Array(_len3 > 3 ? _len3 - 3 : 0), _key3 = 3; _key3 < _len3; _key3++) { | ||
args[_key3 - 3] = arguments[_key3]; | ||
} | ||
return fork.apply(undefined, [throttle$1, ms, pattern, worker].concat(args)); | ||
} | ||
var effects = Object.freeze({ | ||
@@ -2045,5 +2045,5 @@ take: take, | ||
setContext: setContext, | ||
takeEvery: takeEvery, | ||
takeLatest: takeLatest, | ||
throttle: throttle | ||
takeEvery: takeEvery$2, | ||
takeLatest: takeLatest$2, | ||
throttle: throttle$2 | ||
}); | ||
@@ -2074,5 +2074,5 @@ | ||
exports.buffers = buffers; | ||
exports.takeEvery = takeEvery$1; | ||
exports.takeLatest = takeLatest$1; | ||
exports.throttle = throttle$1; | ||
exports.takeEvery = takeEvery; | ||
exports.takeLatest = takeLatest; | ||
exports.throttle = throttle; | ||
exports.delay = delay; | ||
@@ -2079,0 +2079,0 @@ exports.CANCEL = CANCEL; |
@@ -1,1 +0,1 @@ | ||
!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t(n.ReduxSaga={})}(this,function(n){"use strict";function t(n,t,e){if(!t(n))throw c("error","uncaught at check",e),Error(e)}function e(n,t){return nn.notUndef(n)&&$.call(n,t)}function r(n,t){var e=n.indexOf(t);0>e||n.splice(e,1)}function o(){var n=H({},arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),t=new Promise(function(t,e){n.resolve=t,n.reject=e});return n.promise=t,n}function a(n){var t=1>=arguments.length||void 0===arguments[1]||arguments[1],e=void 0,r=new Promise(function(r){e=setTimeout(function(){return r(t)},n)});return r[X]=function(){return clearTimeout(e)},r}function u(n){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:on,e={name:arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",next:n,throw:t,return:an};return arguments[3]&&(e[z]=!0),"undefined"!=typeof Symbol&&(e[Symbol.iterator]=function(){return e}),e}function c(n,t){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";"undefined"==typeof window?console.log("redux-saga "+n+": "+t+"\n"+(e&&e.stack||e)):console[n](t,e)}function i(n,t){return function(){return n.apply(void 0,arguments)}}function f(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,t=arguments[1],e=Array(n),r=0,o=0,a=0,u=function(t){e[o]=t,o=(o+1)%n,r++},c=function(){if(0!=r){var t=e[a];return e[a]=null,r--,a=(a+1)%n,t}},i=function(){for(var n=[];r;)n.push(c());return n};return{isEmpty:function(){return 0==r},put:function(c){if(n>r)u(c);else{var f=void 0;switch(t){case dn:throw Error(sn);case vn:e[o]=c,a=o=(o+1)%n;break;case gn:f=2*n,e=i(),r=e.length,o=e.length,a=0,e.length=f,n=f,u(c)}}},take:c,flush:i}}function l(n){try{d(),n()}finally{v()}}function s(n){yn.push(n),mn||(d(),g())}function d(){mn++}function v(){mn--}function g(){v();for(var n=void 0;!mn&&void 0!==(n=yn.shift());)l(n)}function h(){var n=[];return{subscribe:function(t){return n.push(t),function(){return r(n,t)}},emit:function(t){for(var e=n.slice(),r=0,o=e.length;o>r;r++)e[r](t)}}}function p(){function n(){if(o&&a.length)throw cn("Cannot have a closed channel with pending takers");if(a.length&&!e.isEmpty())throw cn("Cannot have pending takers with non empty buffer")}var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:pn.fixed(),o=!1,a=[];return t(e,nn.buffer,kn),{take:function(u){n(),t(u,nn.func,"channel.take's callback must be a function"),o&&e.isEmpty()?u(bn):e.isEmpty()?(a.push(u),u.cancel=function(){return r(a,u)}):u(e.take())},put:function(r){if(n(),t(r,nn.notUndef,Cn),!o){if(!a.length)return e.put(r);for(var u=0;a.length>u;u++){var c=a[u];if(!c[B]||c[B](r))return a.splice(u,1),c(r)}}},flush:function(r){n(),t(r,nn.func,"channel.flush' callback must be a function"),r(o&&e.isEmpty()?bn:e.flush())},close:function(){if(n(),!o&&(o=!0,a.length)){var t=a;a=[];for(var e=0,r=t.length;r>e;e++)t[e](bn)}},get __takers__(){return a},get __closed__(){return o}}}function y(n){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:pn.none(),r=arguments[2];arguments.length>2&&t(r,nn.func,"Invalid match function passed to eventChannel");var o=p(e),a=function(){o.__closed__||(u&&u(),o.close())},u=n(function(n){En(n)?a():r&&!r(n)||o.put(n)});if(o.__closed__&&u(),!nn.func(u))throw Error("in eventChannel: subscribe should return a function to unsubscribe");return{take:o.take,flush:o.flush,close:a}}function m(n){var e=y(function(t){return n(function(n){n[J]?t(n):s(function(){return t(n)})})});return H({},e,{take:function(n,r){arguments.length>1&&(t(r,nn.func,"channel.take's matcher argument must be a function"),n[B]=r),e.take(n)}})}function b(n){return nn.channel(n)?"channel":Array.isArray(n)?n.map(function(n){return n+""})+"":n+""}function E(n,t){function e(t,e){if(o===An)return _n;if(e)throw o=An,e;r&&r(t);var a=n[o](),u=a[0],c=a[1];return o=u,r=a[2],o===An?_n:c}var r=void 0,o=t;return u(e,function(n){return e(null,n)},arguments.length>2&&void 0!==arguments[2]?arguments[2]:"iterator",!0)}function k(n,t){for(var e=arguments.length,r=Array(e>2?e-2:0),o=2;e>o;o++)r[o-2]=arguments[o];var a={done:!1,value:A(n)},u=function(n){return{done:!1,value:T.apply(void 0,[t].concat(r,[n]))}},c=void 0,i=function(n){return c=n};return E({q1:function(){return["q2",a,i]},q2:function(){return c===bn?[An]:["q1",u(c)]}},"q1","takeEvery("+b(n)+", "+t.name+")")}function C(n,t){for(var e=arguments.length,r=Array(e>2?e-2:0),o=2;e>o;o++)r[o-2]=arguments[o];var a={done:!1,value:A(n)},u=function(n){return{done:!1,value:T.apply(void 0,[t].concat(r,[n]))}},c=function(n){return{done:!1,value:N(n)}},i=void 0,f=void 0,l=function(n){return i=n},s=function(n){return f=n};return E({q1:function(){return["q2",a,s]},q2:function(){return f===bn?[An]:i?["q3",c(i)]:["q1",u(f),l]},q3:function(){return["q1",u(f),l]}},"q1","takeLatest("+b(n)+", "+t.name+")")}function _(n,t,e){for(var r=arguments.length,o=Array(r>3?r-3:0),u=3;r>u;u++)o[u-3]=arguments[u];var c=void 0,i=void 0,f={done:!1,value:R(t,pn.sliding(1))},l=function(){return{done:!1,value:A(i)}},s=function(n){return{done:!1,value:T.apply(void 0,[e].concat(o,[n]))}},d={done:!1,value:j(a,n)},v=function(n){return c=n},g=function(n){return i=n};return E({q1:function(){return["q2",f,g]},q2:function(){return["q3",l(),v]},q3:function(){return c===bn?[An]:["q4",s(c)]},q4:function(){return["q2",d]}},"q1","throttle("+b(t)+", "+e.name+")")}function A(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"*";if(arguments.length&&t(arguments[0],nn.notUndef,"take(patternOrChannel): patternOrChannel is undefined"),nn.pattern(n))return Xn(On,{pattern:n});if(nn.channel(n))return Xn(On,{channel:n});throw Error("take(patternOrChannel): argument "+n+" is not valid channel or a valid pattern")}function x(n,e){return arguments.length>1?(t(n,nn.notUndef,"put(channel, action): argument channel is undefined"),t(n,nn.channel,"put(channel, action): argument "+n+" is not a valid channel"),t(e,nn.notUndef,"put(channel, action): argument action is undefined")):(t(n,nn.notUndef,"put(action): argument action is undefined"),e=n,n=null),Xn(Nn,{channel:n,action:e})}function w(n){return Xn(Rn,n)}function S(n,e,r){t(e,nn.notUndef,n+": argument fn is undefined");var o=null;if(nn.array(e)){var a=e;o=a[0],e=a[1]}else if(e.fn){var u=e;o=u.context,e=u.fn}return o&&nn.string(e)&&nn.func(o[e])&&(e=o[e]),t(e,nn.func,n+": argument "+e+" is not a function"),{context:o,fn:e,args:r}}function j(n){for(var t=arguments.length,e=Array(t>1?t-1:0),r=1;t>r;r++)e[r-1]=arguments[r];return Xn(qn,S("call",n,e))}function T(n){for(var t=arguments.length,e=Array(t>1?t-1:0),r=1;t>r;r++)e[r-1]=arguments[r];return Xn(Mn,S("fork",n,e))}function O(){for(var n=arguments.length,e=Array(n),r=0;n>r;r++)e[r]=arguments[r];if(e.length>1)return w(e.map(function(n){return O(n)}));var o=e[0];return t(o,nn.notUndef,"join(task): argument task is undefined"),t(o,nn.task,"join(task): argument "+o+" is not a valid Task object "+Bn),Xn(In,o)}function N(){for(var n=arguments.length,e=Array(n),r=0;n>r;r++)e[r]=arguments[r];if(e.length>1)return w(e.map(function(n){return N(n)}));var o=e[0];return 1===e.length&&(t(o,nn.notUndef,"cancel(task): argument task is undefined"),t(o,nn.task,"cancel(task): argument "+o+" is not a valid Task object "+Bn)),Xn(Pn,o||Q)}function R(n,e){return t(n,nn.notUndef,"actionChannel(pattern,...): argument pattern is undefined"),arguments.length>1&&(t(e,nn.notUndef,"actionChannel(pattern, buffer): argument buffer is undefined"),t(e,nn.buffer,"actionChannel(pattern, buffer): argument "+e+" is not a valid buffer")),Xn(Hn,{pattern:n,buffer:e})}function L(n){return("*"===n?nt.wildcard:nn.array(n)?nt.array:nn.stringableFunc(n)?nt.default:nn.func(n)?nt.predicate:nt.default)(n)}function q(n,t,e){function o(n){u(),e(n,!0)}function a(n){c.push(n),n.cont=function(a,u){f||(r(c,n),n.cont=Y,u?o(a):(n===t&&(i=a),c.length||(f=!0,e(i))))}}function u(){f||(f=!0,c.forEach(function(n){n.cont=Y,n.cancel()}),c=[])}var c=[],i=void 0,f=!1;return a(t),{addTask:a,cancelAll:u,abort:o,getTasks:function(){return c},taskNames:function(){return c.map(function(n){return n.name})}}}function U(n){var t=n.context,e=n.fn,r=n.args;if(nn.iterator(e))return e;var o=void 0,a=void 0;try{o=e.apply(t,r)}catch(n){a=n}return nn.iterator(o)?o:u(a?function(){throw a}:function(){var n=void 0,t={done:!1,value:o},e=function(n){return{done:!0,value:n}};return function(r){return n?e(r):(n=!0,t)}}())}function M(n){function e(){n._isRunning&&!n._isCancelled&&(n._isCancelled=!0,vn.cancelAll(),u($n))}function a(t,e){if(!dn.isRunning)throw Error("Trying to resume an already finished generator");try{var r=void 0;e?r=n.throw(t):t===$n?(dn.isCancelled=!0,a.cancel(),r=nn.func(n.return)?n.return($n):{done:!0,value:$n}):r=t===Zn?nn.func(n.return)?n.return():{done:!0}:n.next(t),r.done?(dn.isMainRunning=!1,dn.cont&&dn.cont(r.value)):f(r.value,z,"",a)}catch(n){dn.isCancelled&&an(n),dn.isMainRunning=!1,dn.cont(n,!0)}}function u(t,e){n._isRunning=!1,cn.close(),e?(t instanceof Error&&Object.defineProperty(t,"sagaStack",{value:"at "+B+" \n "+(t.sagaStack||t.stack),configurable:!0}),sn.cont||(t instanceof Error&&$?$(t):an(t)),n._error=t,n._isAborted=!0,n._deferredEnd&&n._deferredEnd.reject(t)):(n._result=t,n._deferredEnd&&n._deferredEnd.resolve(t)),sn.cont&&sn.cont(t,e),sn.joiners.forEach(function(n){return n.cb(t,e)}),sn.joiners=null}function f(n,t){function e(n,t){u||(u=!0,o.cancel=Y,W&&(t?W.effectRejected(a,n):W.effectResolved(a,n)),o(n,t))}var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",o=arguments[3],a=rn();W&&W.effectTriggered({effectId:a,parentEffectId:t,label:r,effect:n});var u=void 0;e.cancel=Y,o.cancel=function(){if(!u){u=!0;try{e.cancel()}catch(n){an(n)}e.cancel=Y,W&&W.effectCancelled(a)}};var c=void 0;return nn.promise(n)?l(n,e):nn.helper(n)?k(tt(n),a,e):nn.iterator(n)?v(n,a,B,e):nn.array(n)?V(n,a,e):(c=Wn.take(n))?h(c,e):(c=Wn.put(n))?p(c,e):(c=Wn.all(n))?A(c,a,e):(c=Wn.race(n))?x(c,a,e):(c=Wn.call(n))?b(c,a,e):(c=Wn.cps(n))?E(c,e):(c=Wn.fork(n))?k(c,a,e):(c=Wn.join(n))?C(c,e):(c=Wn.cancel(n))?_(c,e):(c=Wn.select(n))?w(c,e):(c=Wn.actionChannel(n))?S(c,e):(c=Wn.flush(n))?T(c,e):(c=Wn.cancelled(n))?j(c,e):(c=Wn.getContext(n))?O(c,e):(c=Wn.setContext(n))?N(c,e):e(n)}function l(n,t){var e=n[X];nn.func(e)?t.cancel=e:nn.func(n.abort)&&(t.cancel=function(){return n.abort()}),n.then(t,function(n){return t(n,!0)})}function v(n,t,e,r){M(n,R,I,P,ln,F,t,e,r)}function h(n,t){var e=n.channel,r=n.pattern,o=n.maybe;e=e||cn;var a=function(n){return n instanceof Error?t(n,!0):t(En(n)&&!o?Zn:n)};try{e.take(a,L(r))}catch(n){return t(n,!0)}t.cancel=a.cancel}function p(n,t){var e=n.channel,r=n.action,o=n.resolve;s(function(){var n=void 0;try{n=(e?e.put:I)(r)}catch(n){if(e||o)return t(n,!0);an(n)}if(!o||!nn.promise(n))return t(n);l(n,t)})}function b(n,t,e){var r=n.context,o=n.fn,a=n.args,u=void 0;try{u=o.apply(r,a)}catch(n){return e(n,!0)}return nn.promise(u)?l(u,e):nn.iterator(u)?v(u,t,o.name,e):e(u)}function E(n,t){var e=n.context,r=n.fn,o=n.args;try{var a=function(n,e){return nn.undef(n)?t(e):t(n,!0)};r.apply(e,o.concat(a)),a.cancel&&(t.cancel=function(){return a.cancel()})}catch(n){return t(n,!0)}}function k(n,t,e){var r=n.context,o=n.fn,a=n.args,u=n.detached,c=U({context:r,fn:o,args:a});try{d();var i=M(c,R,I,P,ln,F,t,o.name,u?null:Y);u?e(i):c._isRunning?(vn.addTask(i),e(i)):c._error?vn.abort(c._error):e(i)}finally{g()}}function C(n,t){if(n.isRunning()){var e={task:sn,cb:t};t.cancel=function(){return r(n.joiners,e)},n.joiners.push(e)}else n.isAborted()?t(n.error(),!0):t(n.result())}function _(n,t){n===Q&&(n=sn),n.isRunning()&&n.cancel(),t()}function A(n,t,e){function r(){a===o.length&&(u=!0,e(nn.array(n)?en.from(H({},c,{length:o.length})):c))}var o=Object.keys(n);if(!o.length)return e(nn.array(n)?[]:{});var a=0,u=void 0,c={},i={};o.forEach(function(n){var t=function(t,o){u||(o||En(t)||t===Zn||t===$n?(e.cancel(),e(t,o)):(c[n]=t,a++,r()))};t.cancel=Y,i[n]=t}),e.cancel=function(){u||(u=!0,o.forEach(function(n){return i[n].cancel()}))},o.forEach(function(e){return f(n[e],t,e,i[e])})}function x(n,t,e){var r=void 0,o=Object.keys(n),a={};o.forEach(function(t){var u=function(a,u){if(!r)if(u)e.cancel(),e(a,!0);else if(!En(a)&&a!==Zn&&a!==$n){var c;e.cancel(),r=!0;var i=(c={},c[t]=a,c);e(nn.array(n)?[].slice.call(H({},i,{length:o.length})):i)}};u.cancel=Y,a[t]=u}),e.cancel=function(){r||(r=!0,o.forEach(function(n){return a[n].cancel()}))},o.forEach(function(e){r||f(n[e],t,e,a[e])})}function w(n,t){var e=n.selector,r=n.args;try{var o=e.apply(void 0,[P()].concat(r));t(o)}catch(n){t(n,!0)}}function S(n,t){var e=n.pattern,r=n.buffer,o=L(e);o.pattern=e,t(y(R,r||pn.fixed(),o))}function j(n,t){t(!!dn.isCancelled)}function T(n,t){n.flush(t)}function O(n,t){t(ln[n])}function N(n,t){tn.assign(ln,n),t()}var R=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){return Y},I=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Y,P=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Y,G=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},F=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{},z=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0,B=arguments.length>7&&void 0!==arguments[7]?arguments[7]:"anonymous",J=arguments[8];t(n,nn.iterator,Yn);var V=i(A,un("[...effects]","all([...effects])")),W=F.sagaMonitor,Z=F.logger,$=F.onError,on=Z||c,an=function(n){var t=n.sagaStack;!t&&n.stack&&(t=-1!==n.stack.split("\n")[0].indexOf(n.message)?n.stack:"Error: "+n.message+"\n"+n.stack),on("error","uncaught at "+B,t||n.message||n)},cn=m(R),ln=Object.create(G);a.cancel=Y;var sn=function(n,r,a,u){var c,i;return a._deferredEnd=null,c={},c[K]=!0,c.id=n,c.name=r,i={},i.done=i.done||{},i.done.get=function(){if(a._deferredEnd)return a._deferredEnd.promise;var n=o();return a._deferredEnd=n,a._isRunning||(a._error?n.reject(a._error):n.resolve(a._result)),n.promise},c.cont=u,c.joiners=[],c.cancel=e,c.isRunning=function(){return a._isRunning},c.isCancelled=function(){return a._isCancelled},c.isAborted=function(){return a._isAborted},c.result=function(){return a._result},c.error=function(){return a._error},c.setContext=function(n){t(n,nn.object,fn("task",n)),tn.assign(ln,n)},D(c,i),c}(z,B,n,J),dn={name:B,cancel:function(){dn.isRunning&&!dn.isCancelled&&(dn.isCancelled=!0,a($n))},isRunning:!0},vn=q(B,dn,u);return J&&(J.cancel=e),n._isRunning=!0,a(),sn}function I(n,e){for(var r=arguments.length,o=Array(r>2?r-2:0),a=2;r>a;a++)o[a-2]=arguments[a];var u=void 0;nn.iterator(n)?(u=n,n=e):(t(e,nn.func,et),t(u=e.apply(void 0,o),nn.iterator,et));var c=n,i=c.subscribe,f=c.dispatch,l=c.getState,s=c.context,d=c.sagaMonitor,v=c.logger,g=c.onError,h=rn();d&&(d.effectTriggered=d.effectTriggered||Y,d.effectResolved=d.effectResolved||Y,d.effectRejected=d.effectRejected||Y,d.effectCancelled=d.effectCancelled||Y,d.actionDispatched=d.actionDispatched||Y,d.effectTriggered({effectId:h,root:!0,parentEffectId:0,effect:{root:!0,saga:e,args:o}}));var p=M(u,i,ln(f),l,s,{sagaMonitor:d,logger:v,onError:g},h,e.name);return d&&d.effectResolved(h,p),p}var P="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},D=function(n,t){for(var e in t){var r=t[e];r.configurable=r.enumerable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(n,e,r)}return n},H=Object.assign||function(n){for(var t=1;arguments.length>t;t++){var e=arguments[t];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r])}return n},G=function(n,t){var e={};for(var r in n)0>t.indexOf(r)&&Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r]);return e},F=function(n){return"@@redux-saga/"+n},K=F("TASK"),z=F("HELPER"),B=F("MATCH"),X=F("CANCEL_PROMISE"),J=F("SAGA_ACTION"),Q=F("SELF_CANCELLATION"),V=function(n){return function(){return n}},W=V(!0),Y=function(){},Z=function(n){return n},$=Object.prototype.hasOwnProperty,nn={undef:function(n){return null===n||void 0===n},notUndef:function(n){return null!==n&&void 0!==n},func:function(n){return"function"==typeof n},number:function(n){return"number"==typeof n},string:function(n){return"string"==typeof n},array:Array.isArray,object:function(n){return n&&!nn.array(n)&&"object"===(void 0===n?"undefined":P(n))},promise:function(n){return n&&nn.func(n.then)},iterator:function(n){return n&&nn.func(n.next)&&nn.func(n.throw)},iterable:function(n){return n&&nn.func(Symbol)?nn.func(n[Symbol.iterator]):nn.array(n)},task:function(n){return n&&n[K]},observable:function(n){return n&&nn.func(n.subscribe)},buffer:function(n){return n&&nn.func(n.isEmpty)&&nn.func(n.take)&&nn.func(n.put)},pattern:function(n){return n&&(nn.string(n)||"symbol"===(void 0===n?"undefined":P(n))||nn.func(n)||nn.array(n))},channel:function(n){return n&&nn.func(n.take)&&nn.func(n.close)},helper:function(n){return n&&n[z]},stringableFunc:function(n){return nn.func(n)&&e(n,"toString")}},tn={assign:function(n,t){for(var r in t)e(t,r)&&(n[r]=t[r])}},en={from:function(n){var t=Array(n.length);for(var r in n)e(n,r)&&(t[r]=n[r]);return t}},rn=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return function(){return++n}}(),on=function(n){throw n},an=function(n){return{value:n,done:!0}},un=function(n,t){return n+" has been deprecated in favor of "+t+", please update your code"},cn=function(n){return Error("\n redux-saga: Error checking hooks detected an inconsistent state. This is likely a bug\n in redux-saga code and not yours. Thanks for reporting this in the project's github repo.\n Error: "+n+"\n")},fn=function(n,t){return(n?n+".":"")+"setContext(props): argument "+t+" is not a plain object"},ln=function(n){return function(t){return n(Object.defineProperty(t,J,{value:!0}))}},sn="Channel's Buffer overflow!",dn=1,vn=3,gn=4,hn={isEmpty:W,put:Y,take:Y},pn={none:function(){return hn},fixed:function(n){return f(n,dn)},dropping:function(n){return f(n,2)},sliding:function(n){return f(n,vn)},expanding:function(n){return f(n,gn)}},yn=[],mn=0,bn={type:"@@redux-saga/CHANNEL_END"},En=function(n){return n&&"@@redux-saga/CHANNEL_END"===n.type},kn="invalid buffer passed to channel factory function",Cn="Saga was provided with an undefined action",_n={done:!0,value:void 0},An={},xn=function(n){return"import { "+n+" } from 'redux-saga' has been deprecated in favor of import { "+n+" } from 'redux-saga/effects'.\nThe latter will not work with yield*, as helper effects are wrapped automatically for you in fork effect.\nTherefore yield "+n+" will return task descriptor to your saga and execute next lines of code."},wn=i(k,xn("takeEvery")),Sn=i(C,xn("takeLatest")),jn=i(_,xn("throttle")),Tn=F("IO"),On="TAKE",Nn="PUT",Rn="ALL",Ln="RACE",qn="CALL",Un="CPS",Mn="FORK",In="JOIN",Pn="CANCEL",Dn="SELECT",Hn="ACTION_CHANNEL",Gn="CANCELLED",Fn="FLUSH",Kn="GET_CONTEXT",zn="SET_CONTEXT",Bn="\n(HINT: if you are getting this errors in tests, consider using createMockTask from redux-saga/utils)",Xn=function(n,t){var e;return e={},e[Tn]=!0,e[n]=t,e},Jn=function(n){return t(Wn.fork(n),nn.object,"detach(eff): argument must be a fork effect"),n[Mn].detached=!0,n},Qn=i(A.maybe=function(){var n=A.apply(void 0,arguments);return n[On].maybe=!0,n},un("takem","take.maybe"));x.resolve=function(){var n=x.apply(void 0,arguments);return n[Nn].resolve=!0,n},x.sync=i(x.resolve,un("put.sync","put.resolve"));var Vn=function(n){return function(t){return t&&t[Tn]&&t[n]}},Wn={take:Vn(On),put:Vn(Nn),all:Vn(Rn),race:Vn(Ln),call:Vn(qn),cps:Vn(Un),fork:Vn(Mn),join:Vn(In),cancel:Vn(Pn),select:Vn(Dn),actionChannel:Vn(Hn),cancelled:Vn(Gn),flush:Vn(Fn),getContext:Vn(Kn),setContext:Vn(zn)},Yn="proc first argument (Saga function result) must be an iterator",Zn={toString:function(){return"@@redux-saga/CHANNEL_END"}},$n={toString:function(){return"@@redux-saga/TASK_CANCEL"}},nt={wildcard:function(){return W},default:function(n){return"symbol"===(void 0===n?"undefined":P(n))?function(t){return t.type===n}:function(t){return t.type===n+""}},array:function(n){return function(t){return n.some(function(n){return L(n)(t)})}},predicate:function(n){return function(t){return n(t)}}},tt=function(n){return{fn:n}},et="runSaga(storeInterface, saga, ...args): saga argument must be a Generator function!",rt=Object.freeze({take:A,takem:Qn,put:x,all:w,race:function(n){return Xn(Ln,n)},call:j,apply:function(n,t){return Xn(qn,S("apply",{context:n,fn:t},arguments.length>2&&void 0!==arguments[2]?arguments[2]:[]))},cps:function(n){for(var t=arguments.length,e=Array(t>1?t-1:0),r=1;t>r;r++)e[r-1]=arguments[r];return Xn(Un,S("cps",n,e))},fork:T,spawn:function(n){for(var t=arguments.length,e=Array(t>1?t-1:0),r=1;t>r;r++)e[r-1]=arguments[r];return Jn(T.apply(void 0,[n].concat(e)))},join:O,cancel:N,select:function(n){for(var e=arguments.length,r=Array(e>1?e-1:0),o=1;e>o;o++)r[o-1]=arguments[o];return 0===arguments.length?n=Z:(t(n,nn.notUndef,"select(selector,[...]): argument selector is undefined"),t(n,nn.func,"select(selector,[...]): argument "+n+" is not a function")),Xn(Dn,{selector:n,args:r})},actionChannel:R,cancelled:function(){return Xn(Gn,{})},flush:function(n){return t(n,nn.channel,"flush(channel): argument "+n+" is not valid channel"),Xn(Fn,n)},getContext:function(n){return t(n,nn.string,"getContext(prop): argument "+n+" is not a string"),Xn(Kn,n)},setContext:function(n){return t(n,nn.object,fn(null,n)),Xn(zn,n)},takeEvery:function(n,t){for(var e=arguments.length,r=Array(e>2?e-2:0),o=2;e>o;o++)r[o-2]=arguments[o];return T.apply(void 0,[k,n,t].concat(r))},takeLatest:function(n,t){for(var e=arguments.length,r=Array(e>2?e-2:0),o=2;e>o;o++)r[o-2]=arguments[o];return T.apply(void 0,[C,n,t].concat(r))},throttle:function(n,t,e){for(var r=arguments.length,o=Array(r>3?r-3:0),a=3;r>a;a++)o[a-3]=arguments[a];return T.apply(void 0,[_,n,t,e].concat(o))}}),ot=Object.freeze({TASK:K,SAGA_ACTION:J,noop:Y,is:nn,deferred:o,arrayOfDeffered:function(n){for(var t=[],e=0;n>e;e++)t.push(o());return t},createMockTask:function(){var n,t=!0,e=void 0,r=void 0;return n={},n[K]=!0,n.isRunning=function(){return t},n.result=function(){return e},n.error=function(){return r},n.setRunning=function(n){return t=n},n.setResult=function(n){return e=n},n.setError=function(n){return r=n},n},cloneableGenerator:function n(t){return function(){for(var e=arguments.length,r=Array(e),o=0;e>o;o++)r[o]=arguments[o];var a=[],u=t.apply(void 0,r);return{next:function(n){return a.push(n),u.next(n)},clone:function(){var e=n(t).apply(void 0,r);return a.forEach(function(n){return e.next(n)}),e},return:function(n){return u.return(n)},throw:function(n){return u.throw(n)}}}},asEffect:Wn,CHANNEL_END:Zn});n.default=function(){function n(t){var e=t.getState,r=t.dispatch,f=h();return f.emit=(a.emitter||Z)(f.emit),n.run=I.bind(null,{context:o,subscribe:f.subscribe,dispatch:r,getState:e,sagaMonitor:u,logger:c,onError:i}),function(n){return function(t){u&&u.actionDispatched&&u.actionDispatched(t);var e=n(t);return f.emit(t),e}}}var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=e.context,o=void 0===r?{}:r,a=G(e,["context"]),u=a.sagaMonitor,c=a.logger,i=a.onError;if(nn.func(a))throw Error("Saga middleware no longer accept Generator functions. Use sagaMiddleware.run instead");if(c&&!nn.func(c))throw Error("`options.logger` passed to the Saga middleware is not a function!");if(i&&!nn.func(i))throw Error("`options.onError` passed to the Saga middleware is not a function!");if(a.emitter&&!nn.func(a.emitter))throw Error("`options.emitter` passed to the Saga middleware is not a function!");return n.run=function(){throw Error("Before running a Saga, you must mount the Saga middleware on the Store using applyMiddleware")},n.setContext=function(n){t(n,nn.object,fn("sagaMiddleware",n)),tn.assign(o,n)},n},n.effects=rt,n.utils=ot,n.runSaga=I,n.END=bn,n.eventChannel=y,n.channel=p,n.buffers=pn,n.takeEvery=wn,n.takeLatest=Sn,n.throttle=jn,n.delay=a,n.CANCEL=X,n.detach=Jn,Object.defineProperty(n,"__esModule",{value:!0})}); | ||
!function(n,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(n.ReduxSaga={})}(this,function(n){"use strict";var t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},F=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},e=function(n){return"@@redux-saga/"+n},E=e("TASK"),r=e("HELPER"),k=e("MATCH"),C=e("CANCEL_PROMISE"),_=e("SAGA_ACTION"),G=e("SELF_CANCELLATION"),o=function(n){return function(){return n}},a=o(!0),K=function(){},s=function(n){return n};function A(n,e,t){if(!e(n))throw Y("error","uncaught at check",t),Error(t)}var u=Object.prototype.hasOwnProperty;function c(n,e){return z.notUndef(n)&&u.call(n,e)}var z={undef:function(n){return null==n},notUndef:function(n){return null!=n},func:function(n){return"function"==typeof n},number:function(n){return"number"==typeof n},string:function(n){return"string"==typeof n},array:Array.isArray,object:function(n){return n&&!z.array(n)&&"object"===(void 0===n?"undefined":t(n))},promise:function(n){return n&&z.func(n.then)},iterator:function(n){return n&&z.func(n.next)&&z.func(n.throw)},iterable:function(n){return n&&z.func(Symbol)?z.func(n[Symbol.iterator]):z.array(n)},task:function(n){return n&&n[E]},observable:function(n){return n&&z.func(n.subscribe)},buffer:function(n){return n&&z.func(n.isEmpty)&&z.func(n.take)&&z.func(n.put)},pattern:function(n){return n&&(z.string(n)||"symbol"===(void 0===n?"undefined":t(n))||z.func(n)||z.array(n))},channel:function(n){return n&&z.func(n.take)&&z.func(n.close)},helper:function(n){return n&&n[r]},stringableFunc:function(n){return z.func(n)&&c(n,"toString")}},B={assign:function(n,e){for(var t in e)c(e,t)&&(n[t]=e[t])}};function X(n,e){var t=n.indexOf(e);t<0||n.splice(t,1)}var J={from:function(n){var e=Array(n.length);for(var t in n)c(n,t)&&(e[t]=n[t]);return e}};function Q(){var t=F({},0<arguments.length&&void 0!==arguments[0]?arguments[0]:{}),n=new Promise(function(n,e){t.resolve=n,t.reject=e});return t.promise=n,t}function d(e){var t=arguments.length<=1||void 0===arguments[1]||arguments[1],r=void 0,n=new Promise(function(n){r=setTimeout(function(){return n(t)},e)});return n[C]=function(){return clearTimeout(r)},n}function i(){var n=0<arguments.length&&void 0!==arguments[0]?arguments[0]:0;return function(){return++n}}var V=i(),f=function(n){throw n},l=function(n){return{value:n,done:!0}};function W(n){var e={name:2<arguments.length&&void 0!==arguments[2]?arguments[2]:"",next:n,throw:1<arguments.length&&void 0!==arguments[1]?arguments[1]:f,return:l};return arguments[3]&&(e[r]=!0),"undefined"!=typeof Symbol&&(e[Symbol.iterator]=function(){return e}),e}function Y(n,e){var t=2<arguments.length&&void 0!==arguments[2]?arguments[2]:"";"undefined"==typeof window?console.log("redux-saga "+n+": "+e+"\n"+(t&&t.stack||t)):console[n](e,t)}function Z(n,e){return function(){return n.apply(void 0,arguments)}}var $=function(n,e){return n+" has been deprecated in favor of "+e+", please update your code"},v=function(n){return Error("\n redux-saga: Error checking hooks detected an inconsistent state. This is likely a bug\n in redux-saga code and not yours. Thanks for reporting this in the project's github repo.\n Error: "+n+"\n")},nn=function(n,e){return(n?n+".":"")+"setContext(props): argument "+e+" is not a plain object"},h=function(e){return function(n){return e(Object.defineProperty(n,_,{value:!0}))}},g={isEmpty:a,put:K,take:K};function p(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:10,r=arguments[1],o=Array(t),a=0,u=0,c=0,i=function(n){o[u]=n,u=(u+1)%t,a++},e=function(){if(0!=a){var n=o[c];return o[c]=null,a--,c=(c+1)%t,n}},f=function(){for(var n=[];a;)n.push(e());return n};return{isEmpty:function(){return 0==a},put:function(n){if(a<t)i(n);else{var e=void 0;switch(r){case 1:throw Error("Channel's Buffer overflow!");case 3:o[u]=n,c=u=(u+1)%t;break;case 4:e=2*t,o=f(),u=a=o.length,c=0,t=o.length=e,i(n)}}},take:e,flush:f}}var en={none:function(){return g},fixed:function(n){return p(n,1)},dropping:function(n){return p(n,2)},sliding:function(n){return p(n,3)},expanding:function(n){return p(n,4)}},y=[],m=0;function b(n){try{rn(),n()}finally{x()}}function tn(n){y.push(n),m||(rn(),on())}function rn(){m++}function x(){m--}function on(){x();for(var n=void 0;!m&&void 0!==(n=y.shift());)b(n)}var w="@@redux-saga/CHANNEL_END",S={type:w},an=function(n){return n&&n.type===w};var j="invalid buffer passed to channel factory function",T="Saga was provided with an undefined action";function O(){var r=0<arguments.length&&void 0!==arguments[0]?arguments[0]:en.fixed(),o=!1,a=[];function u(){if(o&&a.length)throw v("Cannot have a closed channel with pending takers");if(a.length&&!r.isEmpty())throw v("Cannot have pending takers with non empty buffer")}return A(r,z.buffer,j),{take:function(n){u(),A(n,z.func,"channel.take's callback must be a function"),o&&r.isEmpty()?n(S):r.isEmpty()?(a.push(n),n.cancel=function(){return X(a,n)}):n(r.take())},put:function(n){if(u(),A(n,z.notUndef,T),!o){if(!a.length)return r.put(n);for(var e=0;e<a.length;e++){var t=a[e];if(!t[k]||t[k](n))return a.splice(e,1),t(n)}}},flush:function(n){u(),A(n,z.func,"channel.flush' callback must be a function"),o&&r.isEmpty()?n(S):n(r.flush())},close:function(){if(u(),!o&&(o=!0,a.length)){var n=a;a=[];for(var e=0,t=n.length;e<t;e++)n[e](S)}},get __takers__(){return a},get __closed__(){return o}}}function un(n){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:en.none(),t=arguments[2];2<arguments.length&&A(t,z.func,"Invalid match function passed to eventChannel");var r=O(e),o=function(){r.__closed__||(a&&a(),r.close())},a=n(function(n){an(n)?o():t&&!t(n)||r.put(n)});if(r.__closed__&&a(),!z.func(a))throw Error("in eventChannel: subscribe should return a function to unsubscribe");return{take:r.take,flush:r.flush,close:o}}var R=e("IO"),N="TAKE",L="ALL",q="CALL",U="FORK",P="JOIN",M="CANCEL",I="ACTION_CHANNEL",D="CANCELLED",H="GET_CONTEXT",cn="SET_CONTEXT",fn="\n(HINT: if you are getting this errors in tests, consider using createMockTask from redux-saga/utils)",ln=function(n,e){var t;return(t={})[R]=!0,t[n]=e,t},sn=function(n){return A(Cn.fork(n),z.object,"detach(eff): argument must be a fork effect"),n[U].detached=!0,n};function dn(){var n=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"*";if(arguments.length&&A(arguments[0],z.notUndef,"take(patternOrChannel): patternOrChannel is undefined"),z.pattern(n))return ln(N,{pattern:n});if(z.channel(n))return ln(N,{channel:n});throw Error("take(patternOrChannel): argument "+n+" is not valid channel or a valid pattern")}var vn=Z(dn.maybe=function(){var n=dn.apply(void 0,arguments);return n[N].maybe=!0,n});function gn(n,e){return 1<arguments.length?(A(n,z.notUndef,"put(channel, action): argument channel is undefined"),A(n,z.channel,"put(channel, action): argument "+n+" is not a valid channel"),A(e,z.notUndef,"put(channel, action): argument action is undefined")):(A(n,z.notUndef,"put(action): argument action is undefined"),e=n,n=null),ln("PUT",{channel:n,action:e})}function hn(n){return ln(L,n)}function pn(n,e,t){A(e,z.notUndef,n+": argument fn is undefined");var r=null;if(z.array(e)){r=e[0],e=e[1]}else if(e.fn){r=e.context,e=e.fn}return r&&z.string(e)&&z.func(r[e])&&(e=r[e]),A(e,z.func,n+": argument "+e+" is not a function"),{context:r,fn:e,args:t}}function yn(n){for(var e=arguments.length,t=Array(1<e?e-1:0),r=1;r<e;r++)t[r-1]=arguments[r];return ln(q,pn("call",n,t))}function mn(n){for(var e=arguments.length,t=Array(1<e?e-1:0),r=1;r<e;r++)t[r-1]=arguments[r];return ln(U,pn("fork",n,t))}function bn(){for(var n=arguments.length,e=Array(n),t=0;t<n;t++)e[t]=arguments[t];if(1<e.length)return hn(e.map(function(n){return bn(n)}));var r=e[0];return 1===e.length&&(A(r,z.notUndef,"cancel(task): argument task is undefined"),A(r,z.task,"cancel(task): argument "+r+" is not a valid Task object "+fn)),ln(M,r||G)}function En(n,e){return A(n,z.notUndef,"actionChannel(pattern,...): argument pattern is undefined"),1<arguments.length&&(A(e,z.notUndef,"actionChannel(pattern, buffer): argument buffer is undefined"),A(e,z.buffer,"actionChannel(pattern, buffer): argument "+e+" is not a valid buffer")),ln(I,{pattern:n,buffer:e})}gn.sync=Z(gn.resolve=function(){var n=gn.apply(void 0,arguments);return n.PUT.resolve=!0,n});var kn=function(e){return function(n){return n&&n[R]&&n[e]}},Cn={take:kn(N),put:kn("PUT"),all:kn(L),race:kn("RACE"),call:kn(q),cps:kn("CPS"),fork:kn(U),join:kn(P),cancel:kn(M),select:kn("SELECT"),actionChannel:kn(I),cancelled:kn(D),flush:kn("FLUSH"),getContext:kn(H),setContext:kn(cn)},_n="proc first argument (Saga function result) must be an iterator",An={toString:function(){return"@@redux-saga/CHANNEL_END"}},xn={toString:function(){return"@@redux-saga/TASK_CANCEL"}},wn={wildcard:function(){return a},default:function(e){return"symbol"===(void 0===e?"undefined":t(e))?function(n){return n.type===e}:function(n){return n.type===e+""}},array:function(n){return function(e){return n.some(function(n){return Sn(n)(e)})}},predicate:function(e){return function(n){return e(n)}}};function Sn(n){return("*"===n?wn.wildcard:z.array(n)?wn.array:z.stringableFunc(n)?wn.default:z.func(n)?wn.predicate:wn.default)(n)}var jn=function(n){return{fn:n}};function Tn(r){var x=1<arguments.length&&void 0!==arguments[1]?arguments[1]:function(){return K},w=2<arguments.length&&void 0!==arguments[2]?arguments[2]:K,S=3<arguments.length&&void 0!==arguments[3]?arguments[3]:K,n=4<arguments.length&&void 0!==arguments[4]?arguments[4]:{},c=5<arguments.length&&void 0!==arguments[5]?arguments[5]:{},o=6<arguments.length&&void 0!==arguments[6]?arguments[6]:0,j=7<arguments.length&&void 0!==arguments[7]?arguments[7]:"anonymous",e=arguments[8];A(r,z.iterator,_n);var t,a,u="[...effects]",T=Z(H,$(u,"all("+u+")")),O=c.sagaMonitor,i=c.onError,f=c.logger||Y,R=function(n){var e=n.sagaStack;!e&&n.stack&&(e=-1!=n.stack.split("\n")[0].indexOf(n.message)?n.stack:"Error: "+n.message+"\n"+n.stack),f("error","uncaught at "+j,e||n.message||n)},N=(t=x,a=un(function(e){return t(function(n){n[_]?e(n):tn(function(){return e(n)})})}),F({},a,{take:function(n,e){1<arguments.length&&(A(e,z.func,"channel.take's matcher argument must be a function"),n[k]=e),a.take(n)}})),L=Object.create(n);m.cancel=K;var l,s,d,v,g,h,p,q=(l=o,s=j,v=e,(h={})[E]=!((d=r)._deferredEnd=null),h.id=l,h.name=s,(p={})[g="done"]=p[g]||{},p[g].get=function(){if(d._deferredEnd)return d._deferredEnd.promise;var n=Q();return d._deferredEnd=n,d._isRunning||(d._error?n.reject(d._error):n.resolve(d._result)),n.promise},h.cont=v,h.joiners=[],h.cancel=bn,h.isRunning=function(){return d._isRunning},h.isCancelled=function(){return d._isCancelled},h.isAborted=function(){return d._isAborted},h.result=function(){return d._result},h.error=function(){return d._error},h.setContext=function(n){A(n,z.object,nn("task",n)),B.assign(L,n)},babelHelpers.defineEnumerableProperties(h,p),h),U={name:j,cancel:function(){U.isRunning&&!U.isCancelled&&(U.isCancelled=!0,m(xn))},isRunning:!0},y=function(n,r,o){var a=[],u=void 0,c=!1;function i(n){t(),o(n,!0)}function e(t){a.push(t),t.cont=function(n,e){c||(X(a,t),t.cont=K,e?i(n):(t===r&&(u=n),a.length||(c=!0,o(u))))}}function t(){c||(c=!0,a.forEach(function(n){n.cont=K,n.cancel()}),a=[])}return e(r),{addTask:e,cancelAll:t,abort:i,getTasks:function(){return a},taskNames:function(){return a.map(function(n){return n.name})}}}(0,U,b);return e&&(e.cancel=function(){r._isRunning&&!r._isCancelled&&(r._isCancelled=!0,y.cancelAll(),b(xn))}),r._isRunning=!0,m(),q;function m(n,e){if(!U.isRunning)throw Error("Trying to resume an already finished generator");try{var t=void 0;(t=e?r.throw(n):n===xn?(U.isCancelled=!0,m.cancel(),z.func(r.return)?r.return(xn):{done:!0,value:xn}):n===An?z.func(r.return)?r.return():{done:!0}:r.next(n)).done?(U.isMainRunning=!1,U.cont&&U.cont(t.value)):P(t.value,o,"",m)}catch(n){U.isCancelled&&R(n),U.isMainRunning=!1,U.cont(n,!0)}}function b(e,t){r._isRunning=!1,N.close(),t?(e instanceof Error&&Object.defineProperty(e,"sagaStack",{value:"at "+j+" \n "+(e.sagaStack||e.stack),configurable:!0}),q.cont||(e instanceof Error&&i?i(e):R(e)),r._error=e,r._isAborted=!0,r._deferredEnd&&r._deferredEnd.reject(e)):(r._result=e,r._deferredEnd&&r._deferredEnd.resolve(e)),q.cont&&q.cont(e,t),q.joiners.forEach(function(n){return n.cb(e,t)}),q.joiners=null}function P(n,e){var t=2<arguments.length&&void 0!==arguments[2]?arguments[2]:"",r=arguments[3],o=V();O&&O.effectTriggered({effectId:o,parentEffectId:e,label:t,effect:n});var a=void 0;function u(n,e){a||(a=!0,r.cancel=K,O&&(e?O.effectRejected(o,n):O.effectResolved(o,n)),r(n,e))}u.cancel=K,r.cancel=function(){if(!a){a=!0;try{u.cancel()}catch(n){R(n)}u.cancel=K,O&&O.effectCancelled(o)}};var c,i,f,l,s,d,v,g,h,p,y,m,b,E,k,C,_,A=void 0;return z.promise(n)?M(n,u):z.helper(n)?D(jn(n),o,u):z.iterator(n)?I(n,o,j,u):z.array(n)?T(n,o,u):(A=Cn.take(n))?function(n,e){var t=n.channel,r=n.pattern,o=n.maybe;t=t||N;var a=function(n){return n instanceof Error?e(n,!0):an(n)&&!o?e(An):e(n)};try{t.take(a,Sn(r))}catch(n){return e(n,!0)}e.cancel=a.cancel}(A,u):(A=Cn.put(n))?(E=u,k=(b=A).channel,C=b.action,_=b.resolve,void tn(function(){var n=void 0;try{n=(k?k.put:w)(C)}catch(n){if(k||_)return E(n,!0);R(n)}if(!_||!z.promise(n))return E(n);M(n,E)})):(A=Cn.all(n))?H(A,o,u):(A=Cn.race(n))?(g=o,h=u,p=void 0,m={},(y=Object.keys(v=A)).forEach(function(o){var n=function(n,e){if(!p)if(e)h.cancel(),h(n,!0);else if(!an(n)&&n!==An&&n!==xn){var t;h.cancel(),p=!0;var r=((t={})[o]=n,t);h(z.array(v)?[].slice.call(F({},r,{length:y.length})):r)}};n.cancel=K,m[o]=n}),h.cancel=function(){p||(p=!0,y.forEach(function(n){return m[n].cancel()}))},void y.forEach(function(n){p||P(v[n],g,n,m[n])})):(A=Cn.call(n))?function(n,e,t){var r=n.context,o=n.fn,a=n.args,u=void 0;try{u=o.apply(r,a)}catch(n){return t(n,!0)}return z.promise(u)?M(u,t):z.iterator(u)?I(u,e,o.name,t):t(u)}(A,o,u):(A=Cn.cps(n))?function(n,t){var e=n.context,r=n.fn,o=n.args;try{var a=function(n,e){return z.undef(n)?t(e):t(n,!0)};r.apply(e,o.concat(a)),a.cancel&&(t.cancel=function(){return a.cancel()})}catch(n){return t(n,!0)}}(A,u):(A=Cn.fork(n))?D(A,o,u):(A=Cn.join(n))?function(n,e){if(n.isRunning()){var t={task:q,cb:e};e.cancel=function(){return X(n.joiners,t)},n.joiners.push(t)}else n.isAborted()?e(n.error(),!0):e(n.result())}(A,u):(A=Cn.cancel(n))?function(n,e){n===G&&(n=q);n.isRunning()&&n.cancel();e()}(A,u):(A=Cn.select(n))?function(n,e){var t=n.selector,r=n.args;try{var o=t.apply(void 0,[S()].concat(r));e(o)}catch(n){e(n,!0)}}(A,u):(A=Cn.actionChannel(n))?(f=u,s=(i=A).buffer,(d=Sn(l=i.pattern)).pattern=l,void f(un(x,s||en.fixed(),d))):(A=Cn.flush(n))?void A.flush(u):(A=Cn.cancelled(n))?void u(!!U.isCancelled):(A=Cn.getContext(n))?void u(L[A]):(A=Cn.setContext(n))?(c=u,B.assign(L,A),void c()):u(n)}function M(n,e){var t=n[C];z.func(t)?e.cancel=t:z.func(n.abort)&&(e.cancel=function(){return n.abort()}),n.then(e,function(n){return e(n,!0)})}function I(n,e,t,r){Tn(n,x,w,S,L,c,e,t,r)}function D(n,e,t){var r=n.fn,o=n.detached,a=function(n){var e=n.context,t=n.fn,r=n.args;if(z.iterator(t))return t;var o,a,u=void 0,c=void 0;try{u=t.apply(e,r)}catch(n){c=n}return z.iterator(u)?u:W(c?function(){throw c}:(o=void 0,a={done:!1,value:u},function(n){return o?{done:!0,value:n}:(o=!0,a)}))}({context:n.context,fn:r,args:n.args});try{rn();var u=Tn(a,x,w,S,L,c,e,r.name,o?null:K);o?t(u):a._isRunning?(y.addTask(u),t(u)):a._error?y.abort(a._error):t(u)}finally{on()}}function H(r,e,o){var a=Object.keys(r);if(!a.length)return o(z.array(r)?[]:{});var u=0,c=void 0,i={},f={};a.forEach(function(t){var n=function(n,e){c||(e||an(n)||n===An||n===xn?(o.cancel(),o(n,e)):(i[t]=n,++u===a.length&&(c=!0,o(z.array(r)?J.from(F({},i,{length:a.length})):i))))};n.cancel=K,f[t]=n}),o.cancel=function(){c||(c=!0,a.forEach(function(n){return f[n].cancel()}))},a.forEach(function(n){return P(r[n],e,n,f[n])})}}var On="runSaga(storeInterface, saga, ...args): saga argument must be a Generator function!";function Rn(n,e){for(var t=arguments.length,r=Array(2<t?t-2:0),o=2;o<t;o++)r[o-2]=arguments[o];var a=void 0;z.iterator(n)?(a=n,n=e):(A(e,z.func,On),A(a=e.apply(void 0,r),z.iterator,On));var u=n.subscribe,c=n.dispatch,i=n.getState,f=n.context,l=n.sagaMonitor,s=n.logger,d=n.onError,v=V();l&&(l.effectTriggered=l.effectTriggered||K,l.effectResolved=l.effectResolved||K,l.effectRejected=l.effectRejected||K,l.effectCancelled=l.effectCancelled||K,l.actionDispatched=l.actionDispatched||K,l.effectTriggered({effectId:v,root:!0,parentEffectId:0,effect:{root:!0,saga:e,args:r}}));var g=Tn(a,u,h(c),i,f,{sagaMonitor:l,logger:s,onError:d},v,e.name);return l&&l.effectResolved(v,g),g}var Nn={done:!0,value:void 0},Ln={};function qn(n){return z.channel(n)?"channel":Array.isArray(n)?n.map(function(n){return n+""})+"":n+""}function Un(r,n){var o=void 0,a=n;function e(n,e){if(a===Ln)return Nn;if(e)throw a=Ln,e;o&&o(n);var t=r[a]();return o=t[2],(a=t[0])===Ln?Nn:t[1]}return W(e,function(n){return e(null,n)},2<arguments.length&&void 0!==arguments[2]?arguments[2]:"iterator",!0)}function Pn(n,e){for(var t=arguments.length,r=Array(2<t?t-2:0),o=2;o<t;o++)r[o-2]=arguments[o];var a={done:!1,value:dn(n)},u=void 0,c=function(n){return u=n};return Un({q1:function(){return["q2",a,c]},q2:function(){return u===S?[Ln]:["q1",(n=u,{done:!1,value:mn.apply(void 0,[e].concat(r,[n]))})];var n}},"q1","takeEvery("+qn(n)+", "+e.name+")")}function Mn(n,e){for(var t=arguments.length,r=Array(2<t?t-2:0),o=2;o<t;o++)r[o-2]=arguments[o];var a={done:!1,value:dn(n)},u=function(n){return{done:!1,value:mn.apply(void 0,[e].concat(r,[n]))}},c=void 0,i=void 0,f=function(n){return c=n},l=function(n){return i=n};return Un({q1:function(){return["q2",a,l]},q2:function(){return i===S?[Ln]:c?["q3",(n=c,{done:!1,value:bn(n)})]:["q1",u(i),f];var n},q3:function(){return["q1",u(i),f]}},"q1","takeLatest("+qn(n)+", "+e.name+")")}function In(n,e,t){for(var r=arguments.length,o=Array(3<r?r-3:0),a=3;a<r;a++)o[a-3]=arguments[a];var u=void 0,c=void 0,i={done:!1,value:En(e,en.sliding(1))},f={done:!1,value:yn(d,n)},l=function(n){return u=n},s=function(n){return c=n};return Un({q1:function(){return["q2",i,s]},q2:function(){return["q3",{done:!1,value:dn(c)},l]},q3:function(){return u===S?[Ln]:["q4",(n=u,{done:!1,value:mn.apply(void 0,[t].concat(o,[n]))})];var n},q4:function(){return["q2",f]}},"q1","throttle("+qn(e)+", "+t.name+")")}var Dn=Z(Pn),Hn=Z(Mn),Fn=Z(In);var Gn=Object.freeze({take:dn,takem:vn,put:gn,all:hn,race:function(n){return ln("RACE",n)},call:yn,apply:function(n,e){return ln(q,pn("apply",{context:n,fn:e},2<arguments.length&&void 0!==arguments[2]?arguments[2]:[]))},cps:function(n){for(var e=arguments.length,t=Array(1<e?e-1:0),r=1;r<e;r++)t[r-1]=arguments[r];return ln("CPS",pn("cps",n,t))},fork:mn,spawn:function(n){for(var e=arguments.length,t=Array(1<e?e-1:0),r=1;r<e;r++)t[r-1]=arguments[r];return sn(mn.apply(void 0,[n].concat(t)))},join:function e(){for(var n=arguments.length,t=Array(n),r=0;r<n;r++)t[r]=arguments[r];if(1<t.length)return hn(t.map(function(n){return e(n)}));var o=t[0];return A(o,z.notUndef,"join(task): argument task is undefined"),A(o,z.task,"join(task): argument "+o+" is not a valid Task object "+fn),ln(P,o)},cancel:bn,select:function(n){for(var e=arguments.length,t=Array(1<e?e-1:0),r=1;r<e;r++)t[r-1]=arguments[r];return 0===arguments.length?n=s:(A(n,z.notUndef,"select(selector,[...]): argument selector is undefined"),A(n,z.func,"select(selector,[...]): argument "+n+" is not a function")),ln("SELECT",{selector:n,args:t})},actionChannel:En,cancelled:function(){return ln(D,{})},flush:function(n){return A(n,z.channel,"flush(channel): argument "+n+" is not valid channel"),ln("FLUSH",n)},getContext:function(n){return A(n,z.string,"getContext(prop): argument "+n+" is not a string"),ln(H,n)},setContext:function(n){return A(n,z.object,nn(null,n)),ln(cn,n)},takeEvery:function(n,e){for(var t=arguments.length,r=Array(2<t?t-2:0),o=2;o<t;o++)r[o-2]=arguments[o];return mn.apply(void 0,[Pn,n,e].concat(r))},takeLatest:function(n,e){for(var t=arguments.length,r=Array(2<t?t-2:0),o=2;o<t;o++)r[o-2]=arguments[o];return mn.apply(void 0,[Mn,n,e].concat(r))},throttle:function(n,e,t){for(var r=arguments.length,o=Array(3<r?r-3:0),a=3;a<r;a++)o[a-3]=arguments[a];return mn.apply(void 0,[In,n,e,t].concat(o))}}),Kn=Object.freeze({TASK:E,SAGA_ACTION:_,noop:K,is:z,deferred:Q,arrayOfDeffered:function(n){for(var e=[],t=0;t<n;t++)e.push(Q());return e},createMockTask:function(){var n,e=!0,t=void 0,r=void 0;return(n={})[E]=!0,n.isRunning=function(){return e},n.result=function(){return t},n.error=function(){return r},n.setRunning=function(n){return e=n},n.setResult=function(n){return t=n},n.setError=function(n){return r=n},n},cloneableGenerator:function a(u){return function(){for(var n=arguments.length,t=Array(n),e=0;e<n;e++)t[e]=arguments[e];var r=[],o=u.apply(void 0,t);return{next:function(n){return r.push(n),o.next(n)},clone:function(){var e=a(u).apply(void 0,t);return r.forEach(function(n){return e.next(n)}),e},return:function(n){return o.return(n)},throw:function(n){return o.throw(n)}}}},asEffect:Cn,CHANNEL_END:An});n.default=function(){var n=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},e=n.context,a=void 0===e?{}:e,u=function(n,e){var t={};for(var r in n)e.indexOf(r)<0&&Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r]);return t}(n,["context"]),c=u.sagaMonitor,i=u.logger,f=u.onError;if(z.func(u))throw Error("Saga middleware no longer accept Generator functions. Use sagaMiddleware.run instead");if(i&&!z.func(i))throw Error("`options.logger` passed to the Saga middleware is not a function!");if(f&&!z.func(f))throw Error("`options.onError` passed to the Saga middleware is not a function!");if(u.emitter&&!z.func(u.emitter))throw Error("`options.emitter` passed to the Saga middleware is not a function!");function l(n){var o,e=n.getState,t=n.dispatch,r=(o=[],{subscribe:function(n){return o.push(n),function(){return X(o,n)}},emit:function(n){for(var e=o.slice(),t=0,r=e.length;t<r;t++)e[t](n)}});return r.emit=(u.emitter||s)(r.emit),l.run=Rn.bind(null,{context:a,subscribe:r.subscribe,dispatch:t,getState:e,sagaMonitor:c,logger:i,onError:f}),function(t){return function(n){c&&c.actionDispatched&&c.actionDispatched(n);var e=t(n);return r.emit(n),e}}}return l.run=function(){throw Error("Before running a Saga, you must mount the Saga middleware on the Store using applyMiddleware")},l.setContext=function(n){A(n,z.object,nn("sagaMiddleware",n)),B.assign(a,n)},l},n.effects=Gn,n.utils=Kn,n.runSaga=Rn,n.END=S,n.eventChannel=un,n.channel=O,n.buffers=en,n.takeEvery=Dn,n.takeLatest=Hn,n.throttle=Fn,n.delay=d,n.CANCEL=C,n.detach=sn,Object.defineProperty(n,"__esModule",{value:!0})}); |
@@ -1,1 +0,3 @@ | ||
export { take, takem, put, all, race, call, apply, cps, fork, spawn, join, cancel, select, actionChannel, cancelled, flush, getContext, setContext, takeEvery, takeLatest, throttle } from './internal/io'; | ||
export { take, takem, put, all, race, call, apply, cps, fork, spawn, join, cancel, select, actionChannel, cancelled, flush, getContext, setContext } from './internal/io'; | ||
export { takeEvery, takeLatest, throttle } from './internal/io-helpers'; |
import { sym, is, ident, check, deprecate, updateIncentive, createSetContextWarning, SELF_CANCELLATION } from './utils'; | ||
import { takeEveryHelper, takeLatestHelper, throttleHelper } from './sagaHelpers'; | ||
@@ -225,26 +224,2 @@ var IO = /*#__PURE__*/sym('IO'); | ||
export function takeEvery(patternOrChannel, worker) { | ||
for (var _len8 = arguments.length, args = Array(_len8 > 2 ? _len8 - 2 : 0), _key8 = 2; _key8 < _len8; _key8++) { | ||
args[_key8 - 2] = arguments[_key8]; | ||
} | ||
return fork.apply(undefined, [takeEveryHelper, patternOrChannel, worker].concat(args)); | ||
} | ||
export function takeLatest(patternOrChannel, worker) { | ||
for (var _len9 = arguments.length, args = Array(_len9 > 2 ? _len9 - 2 : 0), _key9 = 2; _key9 < _len9; _key9++) { | ||
args[_key9 - 2] = arguments[_key9]; | ||
} | ||
return fork.apply(undefined, [takeLatestHelper, patternOrChannel, worker].concat(args)); | ||
} | ||
export function throttle(ms, pattern, worker) { | ||
for (var _len10 = arguments.length, args = Array(_len10 > 3 ? _len10 - 3 : 0), _key10 = 3; _key10 < _len10; _key10++) { | ||
args[_key10 - 3] = arguments[_key10]; | ||
} | ||
return fork.apply(undefined, [throttleHelper, ms, pattern, worker].concat(args)); | ||
} | ||
var createAsEffectType = function createAsEffectType(type) { | ||
@@ -251,0 +226,0 @@ return function (effect) { |
@@ -115,6 +115,9 @@ 'use strict'; | ||
}); | ||
var _ioHelpers = /*#__PURE__*/require('./internal/io-helpers'); | ||
Object.defineProperty(exports, 'takeEvery', { | ||
enumerable: true, | ||
get: function get() { | ||
return _io.takeEvery; | ||
return _ioHelpers.takeEvery; | ||
} | ||
@@ -125,3 +128,3 @@ }); | ||
get: function get() { | ||
return _io.takeLatest; | ||
return _ioHelpers.takeLatest; | ||
} | ||
@@ -132,4 +135,4 @@ }); | ||
get: function get() { | ||
return _io.throttle; | ||
return _ioHelpers.throttle; | ||
} | ||
}); |
@@ -22,10 +22,5 @@ 'use strict'; | ||
exports.setContext = setContext; | ||
exports.takeEvery = takeEvery; | ||
exports.takeLatest = takeLatest; | ||
exports.throttle = throttle; | ||
var _utils = /*#__PURE__*/require('./utils'); | ||
var _sagaHelpers = /*#__PURE__*/require('./sagaHelpers'); | ||
var IO = /*#__PURE__*/(0, _utils.sym)('IO'); | ||
@@ -252,26 +247,2 @@ var TAKE = 'TAKE'; | ||
function takeEvery(patternOrChannel, worker) { | ||
for (var _len8 = arguments.length, args = Array(_len8 > 2 ? _len8 - 2 : 0), _key8 = 2; _key8 < _len8; _key8++) { | ||
args[_key8 - 2] = arguments[_key8]; | ||
} | ||
return fork.apply(undefined, [_sagaHelpers.takeEveryHelper, patternOrChannel, worker].concat(args)); | ||
} | ||
function takeLatest(patternOrChannel, worker) { | ||
for (var _len9 = arguments.length, args = Array(_len9 > 2 ? _len9 - 2 : 0), _key9 = 2; _key9 < _len9; _key9++) { | ||
args[_key9 - 2] = arguments[_key9]; | ||
} | ||
return fork.apply(undefined, [_sagaHelpers.takeLatestHelper, patternOrChannel, worker].concat(args)); | ||
} | ||
function throttle(ms, pattern, worker) { | ||
for (var _len10 = arguments.length, args = Array(_len10 > 3 ? _len10 - 3 : 0), _key10 = 3; _key10 < _len10; _key10++) { | ||
args[_key10 - 3] = arguments[_key10]; | ||
} | ||
return fork.apply(undefined, [_sagaHelpers.throttleHelper, ms, pattern, worker].concat(args)); | ||
} | ||
var createAsEffectType = function createAsEffectType(type) { | ||
@@ -278,0 +249,0 @@ return function (effect) { |
{ | ||
"name": "redux-saga", | ||
"version": "0.16.0", | ||
"version": "0.16.1", | ||
"description": "Saga middleware for Redux to handle Side Effects", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
44
274502