@vve/redux-saga 9.0.0-alpha.2 → 9.0.0-alpha.4
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/es/effects.js +3 -2
- package/es/effects.js.map +1 -0
- package/es/index.js +11 -10
- package/es/index.js.map +1 -0
- package/es/internal/buffers.js +21 -45
- package/es/internal/buffers.js.map +1 -0
- package/es/internal/channel.js +36 -87
- package/es/internal/channel.js.map +1 -0
- package/es/internal/channels-trans-table.png +0 -0
- package/es/internal/convenient-io.js +6 -19
- package/es/internal/convenient-io.js.map +1 -0
- package/es/internal/io-helpers.js +7 -9
- package/es/internal/io-helpers.js.map +1 -0
- package/es/internal/io.js +70 -113
- package/es/internal/io.js.map +1 -0
- package/es/internal/middleware.js +42 -45
- package/es/internal/middleware.js.map +1 -0
- package/es/internal/proc.js +188 -358
- package/es/internal/proc.js.map +1 -0
- package/es/internal/runSaga.js +20 -27
- package/es/internal/runSaga.js.map +1 -0
- package/es/internal/sagaHelpers/fsmIterator.js +13 -22
- package/es/internal/sagaHelpers/fsmIterator.js.map +1 -0
- package/es/internal/sagaHelpers/index.js +12 -13
- package/es/internal/sagaHelpers/index.js.map +1 -0
- package/es/internal/sagaHelpers/takeEvery.js +13 -20
- package/es/internal/sagaHelpers/takeEvery.js.map +1 -0
- package/es/internal/sagaHelpers/takeLatest.js +19 -33
- package/es/internal/sagaHelpers/takeLatest.js.map +1 -0
- package/es/internal/sagaHelpers/throttle.js +22 -36
- package/es/internal/sagaHelpers/throttle.js.map +1 -0
- package/es/internal/scheduler.js +7 -11
- package/es/internal/scheduler.js.map +1 -0
- package/es/internal/utils.js +101 -205
- package/es/internal/utils.js.map +1 -0
- package/es/utils.js +5 -4
- package/es/utils.js.map +1 -0
- package/lib/effects.js +138 -30
- package/lib/effects.js.map +1 -0
- package/lib/index.js +86 -48
- package/lib/index.js.map +1 -0
- package/lib/internal/buffers.js +24 -48
- package/lib/internal/buffers.js.map +1 -0
- package/lib/internal/channel.js +43 -100
- package/lib/internal/channel.js.map +1 -0
- package/lib/internal/channels-trans-table.png +0 -0
- package/lib/internal/convenient-io.js +10 -23
- package/lib/internal/convenient-io.js.map +1 -0
- package/lib/internal/io-helpers.js +10 -15
- package/lib/internal/io-helpers.js.map +1 -0
- package/lib/internal/io.js +89 -149
- package/lib/internal/io.js.map +1 -0
- package/lib/internal/middleware.js +46 -51
- package/lib/internal/middleware.js.map +1 -0
- package/lib/internal/proc.js +194 -372
- package/lib/internal/proc.js.map +1 -0
- package/lib/internal/runSaga.js +25 -35
- package/lib/internal/runSaga.js.map +1 -0
- package/lib/internal/sagaHelpers/fsmIterator.js +19 -29
- package/lib/internal/sagaHelpers/fsmIterator.js.map +1 -0
- package/lib/internal/sagaHelpers/index.js +37 -27
- package/lib/internal/sagaHelpers/index.js.map +1 -0
- package/lib/internal/sagaHelpers/takeEvery.js +19 -31
- package/lib/internal/sagaHelpers/takeEvery.js.map +1 -0
- package/lib/internal/sagaHelpers/takeLatest.js +25 -44
- package/lib/internal/sagaHelpers/takeLatest.js.map +1 -0
- package/lib/internal/sagaHelpers/throttle.js +28 -49
- package/lib/internal/sagaHelpers/throttle.js.map +1 -0
- package/lib/internal/scheduler.js +11 -15
- package/lib/internal/scheduler.js.map +1 -0
- package/lib/internal/utils.js +119 -247
- package/lib/internal/utils.js.map +1 -0
- package/lib/utils.js +69 -22
- package/lib/utils.js.map +1 -0
- package/package.json +5 -4
|
@@ -1,34 +1,29 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
exports
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
4
6
|
exports.takeEvery = takeEvery;
|
|
5
7
|
exports.takeLatest = takeLatest;
|
|
6
8
|
exports.throttle = throttle;
|
|
7
|
-
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
var _sagaHelpers = /*#__PURE__*/require("./sagaHelpers");
|
|
11
|
-
|
|
9
|
+
var _io = require("./io");
|
|
10
|
+
var _sagaHelpers = require("./sagaHelpers");
|
|
12
11
|
function takeEvery(patternOrChannel, worker) {
|
|
13
12
|
for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
|
14
13
|
args[_key - 2] = arguments[_key];
|
|
15
14
|
}
|
|
16
|
-
|
|
17
|
-
return _io.fork.apply(void 0, [_sagaHelpers.takeEveryHelper, patternOrChannel, worker].concat(args));
|
|
15
|
+
return (0, _io.fork)(_sagaHelpers.takeEveryHelper, patternOrChannel, worker, ...args);
|
|
18
16
|
}
|
|
19
|
-
|
|
20
17
|
function takeLatest(patternOrChannel, worker) {
|
|
21
18
|
for (var _len2 = arguments.length, args = new Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
|
|
22
19
|
args[_key2 - 2] = arguments[_key2];
|
|
23
20
|
}
|
|
24
|
-
|
|
25
|
-
return _io.fork.apply(void 0, [_sagaHelpers.takeLatestHelper, patternOrChannel, worker].concat(args));
|
|
21
|
+
return (0, _io.fork)(_sagaHelpers.takeLatestHelper, patternOrChannel, worker, ...args);
|
|
26
22
|
}
|
|
27
|
-
|
|
28
23
|
function throttle(ms, pattern, worker) {
|
|
29
24
|
for (var _len3 = arguments.length, args = new Array(_len3 > 3 ? _len3 - 3 : 0), _key3 = 3; _key3 < _len3; _key3++) {
|
|
30
25
|
args[_key3 - 3] = arguments[_key3];
|
|
31
26
|
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
27
|
+
return (0, _io.fork)(_sagaHelpers.throttleHelper, ms, pattern, worker, ...args);
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=io-helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"io-helpers.js","names":["_io","require","_sagaHelpers","takeEvery","patternOrChannel","worker","_len","arguments","length","args","Array","_key","fork","takeEveryHelper","takeLatest","_len2","_key2","takeLatestHelper","throttle","ms","pattern","_len3","_key3","throttleHelper"],"sources":["../../io-helpers.js"],"sourcesContent":["import { fork } from './io'\nimport { takeEveryHelper, takeLatestHelper, throttleHelper } from './sagaHelpers'\n\nexport function takeEvery(patternOrChannel, worker, ...args) {\n return fork(takeEveryHelper, patternOrChannel, worker, ...args)\n}\n\nexport function takeLatest(patternOrChannel, worker, ...args) {\n return fork(takeLatestHelper, patternOrChannel, worker, ...args)\n}\n\nexport function throttle(ms, pattern, worker, ...args) {\n return fork(throttleHelper, ms, pattern, worker, ...args)\n}\n"],"mappings":";;;;;;;;AAAA,IAAAA,GAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAEO,SAASE,SAASA,CAACC,gBAAgB,EAAEC,MAAM,EAAW;EAAA,SAAAC,IAAA,GAAAC,SAAA,CAAAC,MAAA,EAANC,IAAI,OAAAC,KAAA,CAAAJ,IAAA,OAAAA,IAAA,WAAAK,IAAA,MAAAA,IAAA,GAAAL,IAAA,EAAAK,IAAA;IAAJF,IAAI,CAAAE,IAAA,QAAAJ,SAAA,CAAAI,IAAA;EAAA;EACzD,OAAO,IAAAC,QAAI,EAACC,4BAAe,EAAET,gBAAgB,EAAEC,MAAM,EAAE,GAAGI,IAAI,CAAC;AACjE;AAEO,SAASK,UAAUA,CAACV,gBAAgB,EAAEC,MAAM,EAAW;EAAA,SAAAU,KAAA,GAAAR,SAAA,CAAAC,MAAA,EAANC,IAAI,OAAAC,KAAA,CAAAK,KAAA,OAAAA,KAAA,WAAAC,KAAA,MAAAA,KAAA,GAAAD,KAAA,EAAAC,KAAA;IAAJP,IAAI,CAAAO,KAAA,QAAAT,SAAA,CAAAS,KAAA;EAAA;EAC1D,OAAO,IAAAJ,QAAI,EAACK,6BAAgB,EAAEb,gBAAgB,EAAEC,MAAM,EAAE,GAAGI,IAAI,CAAC;AAClE;AAEO,SAASS,QAAQA,CAACC,EAAE,EAAEC,OAAO,EAAEf,MAAM,EAAW;EAAA,SAAAgB,KAAA,GAAAd,SAAA,CAAAC,MAAA,EAANC,IAAI,OAAAC,KAAA,CAAAW,KAAA,OAAAA,KAAA,WAAAC,KAAA,MAAAA,KAAA,GAAAD,KAAA,EAAAC,KAAA;IAAJb,IAAI,CAAAa,KAAA,QAAAf,SAAA,CAAAe,KAAA;EAAA;EACnD,OAAO,IAAAV,QAAI,EAACW,2BAAc,EAAEJ,EAAE,EAAEC,OAAO,EAAEf,MAAM,EAAE,GAAGI,IAAI,CAAC;AAC3D"}
|
package/lib/internal/io.js
CHANGED
|
@@ -1,31 +1,35 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
exports
|
|
5
|
-
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.actionChannel = actionChannel;
|
|
6
8
|
exports.all = all;
|
|
7
|
-
exports.race = race;
|
|
8
|
-
exports.call = call;
|
|
9
9
|
exports.apply = apply;
|
|
10
|
+
exports.asEffect = void 0;
|
|
11
|
+
exports.call = call;
|
|
12
|
+
exports.cancel = cancel;
|
|
13
|
+
exports.cancelled = cancelled;
|
|
10
14
|
exports.cps = cps;
|
|
15
|
+
exports.detach = void 0;
|
|
16
|
+
exports.flush = flush;
|
|
11
17
|
exports.fork = fork;
|
|
12
|
-
exports.
|
|
18
|
+
exports.getContext = getContext;
|
|
13
19
|
exports.join = join;
|
|
14
|
-
exports.
|
|
20
|
+
exports.put = put;
|
|
21
|
+
exports.putAsyncAction = putAsyncAction;
|
|
22
|
+
exports.putMutation = putMutation;
|
|
23
|
+
exports.race = race;
|
|
15
24
|
exports.select = select;
|
|
16
25
|
exports.selectSelf = selectSelf;
|
|
17
|
-
exports.putMutation = putMutation;
|
|
18
|
-
exports.putAsyncAction = putAsyncAction;
|
|
19
|
-
exports.actionChannel = actionChannel;
|
|
20
|
-
exports.cancelled = cancelled;
|
|
21
|
-
exports.flush = flush;
|
|
22
|
-
exports.getContext = getContext;
|
|
23
26
|
exports.setContext = setContext;
|
|
24
|
-
exports.
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
var
|
|
27
|
+
exports.spawn = spawn;
|
|
28
|
+
exports.take = take;
|
|
29
|
+
exports.takem = void 0;
|
|
30
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
31
|
+
var _utils = require("./utils");
|
|
32
|
+
var IO = (0, _utils.sym)('IO');
|
|
29
33
|
var TAKE = 'TAKE';
|
|
30
34
|
var PUT = 'PUT';
|
|
31
35
|
var ALL = 'ALL';
|
|
@@ -45,289 +49,225 @@ var FLUSH = 'FLUSH';
|
|
|
45
49
|
var GET_CONTEXT = 'GET_CONTEXT';
|
|
46
50
|
var SET_CONTEXT = 'SET_CONTEXT';
|
|
47
51
|
var TEST_HINT = '\n(HINT: if you are getting this errors in tests, consider using createMockTask from redux-saga/utils)';
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
var detach = function detach(eff) {
|
|
52
|
+
var effect = (type, payload) => ({
|
|
53
|
+
[IO]: true,
|
|
54
|
+
[type]: payload
|
|
55
|
+
});
|
|
56
|
+
var detach = eff => {
|
|
56
57
|
(0, _utils.check)(asEffect.fork(eff), _utils.is.object, 'detach(eff): argument must be a fork effect');
|
|
57
58
|
eff[FORK].detached = true;
|
|
58
59
|
return eff;
|
|
59
60
|
};
|
|
60
|
-
|
|
61
61
|
exports.detach = detach;
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
if (patternOrChannel === void 0) {
|
|
65
|
-
patternOrChannel = '*';
|
|
66
|
-
}
|
|
67
|
-
|
|
62
|
+
function take() {
|
|
63
|
+
var patternOrChannel = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '*';
|
|
68
64
|
if (arguments.length) {
|
|
69
65
|
(0, _utils.check)(arguments[0], _utils.is.notUndef, 'take(patternOrChannel): patternOrChannel is undefined');
|
|
70
66
|
}
|
|
71
|
-
|
|
72
67
|
if (_utils.is.pattern(patternOrChannel)) {
|
|
73
68
|
return effect(TAKE, {
|
|
74
69
|
pattern: patternOrChannel
|
|
75
70
|
});
|
|
76
71
|
}
|
|
77
|
-
|
|
78
72
|
if (_utils.is.channel(patternOrChannel)) {
|
|
79
73
|
return effect(TAKE, {
|
|
80
74
|
channel: patternOrChannel
|
|
81
75
|
});
|
|
82
76
|
}
|
|
83
|
-
|
|
84
|
-
throw new Error("take(patternOrChannel): argument " + String(patternOrChannel) + " is not valid channel or a valid pattern");
|
|
77
|
+
throw new Error(`take(patternOrChannel): argument ${String(patternOrChannel)} is not valid channel or a valid pattern`);
|
|
85
78
|
}
|
|
86
|
-
|
|
87
79
|
take.maybe = function () {
|
|
88
|
-
var eff = take
|
|
80
|
+
var eff = take(...arguments);
|
|
89
81
|
eff[TAKE].maybe = true;
|
|
90
82
|
return eff;
|
|
91
83
|
};
|
|
92
|
-
|
|
93
|
-
var takem = /*#__PURE__*/(0, _utils.deprecate)(take.maybe, /*#__PURE__*/(0, _utils.updateIncentive)('takem', 'take.maybe'));
|
|
84
|
+
var takem = (0, _utils.deprecate)(take.maybe, (0, _utils.updateIncentive)('takem', 'take.maybe'));
|
|
94
85
|
exports.takem = takem;
|
|
95
|
-
|
|
96
86
|
function put(channel, action) {
|
|
97
87
|
if (arguments.length > 1) {
|
|
98
88
|
(0, _utils.check)(channel, _utils.is.notUndef, 'put(channel, action): argument channel is undefined');
|
|
99
|
-
(0, _utils.check)(channel, _utils.is.channel,
|
|
89
|
+
(0, _utils.check)(channel, _utils.is.channel, `put(channel, action): argument ${channel} is not a valid channel`);
|
|
100
90
|
(0, _utils.check)(action, _utils.is.notUndef, 'put(channel, action): argument action is undefined');
|
|
101
91
|
} else {
|
|
102
92
|
(0, _utils.check)(channel, _utils.is.notUndef, 'put(action): argument action is undefined');
|
|
103
93
|
action = channel;
|
|
104
94
|
channel = null;
|
|
105
95
|
}
|
|
106
|
-
|
|
107
96
|
return effect(PUT, {
|
|
108
|
-
channel
|
|
109
|
-
action
|
|
97
|
+
channel,
|
|
98
|
+
action
|
|
110
99
|
});
|
|
111
100
|
}
|
|
112
|
-
|
|
113
101
|
put.resolve = function () {
|
|
114
|
-
var eff = put
|
|
102
|
+
var eff = put(...arguments);
|
|
115
103
|
eff[PUT].resolve = true;
|
|
116
104
|
return eff;
|
|
117
105
|
};
|
|
118
|
-
|
|
119
|
-
put.sync = /*#__PURE__*/(0, _utils.deprecate)(put.resolve, /*#__PURE__*/(0, _utils.updateIncentive)('put.sync', 'put.resolve'));
|
|
120
|
-
|
|
106
|
+
put.sync = (0, _utils.deprecate)(put.resolve, (0, _utils.updateIncentive)('put.sync', 'put.resolve'));
|
|
121
107
|
function all(effects) {
|
|
122
108
|
return effect(ALL, effects);
|
|
123
109
|
}
|
|
124
|
-
|
|
125
110
|
function race(effects) {
|
|
126
111
|
return effect(RACE, effects);
|
|
127
112
|
}
|
|
128
|
-
|
|
129
113
|
function getFnCallDesc(meth, fn, args) {
|
|
130
|
-
(0, _utils.check)(fn, _utils.is.notUndef, meth
|
|
114
|
+
(0, _utils.check)(fn, _utils.is.notUndef, `${meth}: argument fn is undefined`);
|
|
131
115
|
var context = null;
|
|
132
|
-
|
|
133
116
|
if (_utils.is.array(fn)) {
|
|
134
117
|
var _fn = fn;
|
|
135
|
-
|
|
136
|
-
|
|
118
|
+
var _fn2 = (0, _slicedToArray2.default)(_fn, 2);
|
|
119
|
+
context = _fn2[0];
|
|
120
|
+
fn = _fn2[1];
|
|
137
121
|
} else if (fn.fn) {
|
|
138
|
-
var
|
|
139
|
-
context =
|
|
140
|
-
fn =
|
|
122
|
+
var _fn3 = fn;
|
|
123
|
+
context = _fn3.context;
|
|
124
|
+
fn = _fn3.fn;
|
|
141
125
|
}
|
|
142
|
-
|
|
143
126
|
if (context && _utils.is.string(fn) && _utils.is.func(context[fn])) {
|
|
144
127
|
fn = context[fn];
|
|
145
128
|
}
|
|
146
|
-
|
|
147
|
-
(0, _utils.check)(fn, _utils.is.func, meth + ": argument " + fn + " is not a function");
|
|
129
|
+
(0, _utils.check)(fn, _utils.is.func, `${meth}: argument ${fn} is not a function`);
|
|
148
130
|
return {
|
|
149
|
-
context
|
|
150
|
-
fn
|
|
151
|
-
args
|
|
131
|
+
context,
|
|
132
|
+
fn,
|
|
133
|
+
args
|
|
152
134
|
};
|
|
153
135
|
}
|
|
154
|
-
|
|
155
136
|
function call(fn) {
|
|
156
137
|
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
157
138
|
args[_key - 1] = arguments[_key];
|
|
158
139
|
}
|
|
159
|
-
|
|
160
140
|
return effect(CALL, getFnCallDesc('call', fn, args));
|
|
161
141
|
}
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
if (args === void 0) {
|
|
165
|
-
args = [];
|
|
166
|
-
}
|
|
167
|
-
|
|
142
|
+
function apply(context, fn) {
|
|
143
|
+
var args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
|
|
168
144
|
return effect(CALL, getFnCallDesc('apply', {
|
|
169
|
-
context
|
|
170
|
-
fn
|
|
145
|
+
context,
|
|
146
|
+
fn
|
|
171
147
|
}, args));
|
|
172
148
|
}
|
|
173
|
-
|
|
174
149
|
function cps(fn) {
|
|
175
150
|
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
176
151
|
args[_key2 - 1] = arguments[_key2];
|
|
177
152
|
}
|
|
178
|
-
|
|
179
153
|
return effect(CPS, getFnCallDesc('cps', fn, args));
|
|
180
154
|
}
|
|
181
|
-
|
|
182
155
|
function fork(fn) {
|
|
183
156
|
for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
|
|
184
157
|
args[_key3 - 1] = arguments[_key3];
|
|
185
158
|
}
|
|
186
|
-
|
|
187
159
|
return effect(FORK, getFnCallDesc('fork', fn, args));
|
|
188
160
|
}
|
|
189
|
-
|
|
190
161
|
function spawn(fn) {
|
|
191
162
|
for (var _len4 = arguments.length, args = new Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) {
|
|
192
163
|
args[_key4 - 1] = arguments[_key4];
|
|
193
164
|
}
|
|
194
|
-
|
|
195
|
-
return detach(fork.apply(void 0, [fn].concat(args)));
|
|
165
|
+
return detach(fork(fn, ...args));
|
|
196
166
|
}
|
|
197
|
-
|
|
198
167
|
function join() {
|
|
199
168
|
for (var _len5 = arguments.length, tasks = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
|
|
200
169
|
tasks[_key5] = arguments[_key5];
|
|
201
170
|
}
|
|
202
|
-
|
|
203
171
|
if (tasks.length > 1) {
|
|
204
|
-
return all(tasks.map(
|
|
205
|
-
return join(t);
|
|
206
|
-
}));
|
|
172
|
+
return all(tasks.map(t => join(t)));
|
|
207
173
|
}
|
|
208
|
-
|
|
209
174
|
var task = tasks[0];
|
|
210
175
|
(0, _utils.check)(task, _utils.is.notUndef, 'join(task): argument task is undefined');
|
|
211
|
-
(0, _utils.check)(task, _utils.is.task,
|
|
176
|
+
(0, _utils.check)(task, _utils.is.task, `join(task): argument ${task} is not a valid Task object ${TEST_HINT}`);
|
|
212
177
|
return effect(JOIN, task);
|
|
213
178
|
}
|
|
214
|
-
|
|
215
179
|
function cancel() {
|
|
216
180
|
for (var _len6 = arguments.length, tasks = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {
|
|
217
181
|
tasks[_key6] = arguments[_key6];
|
|
218
182
|
}
|
|
219
|
-
|
|
220
183
|
if (tasks.length > 1) {
|
|
221
|
-
return all(tasks.map(
|
|
222
|
-
return cancel(t);
|
|
223
|
-
}));
|
|
184
|
+
return all(tasks.map(t => cancel(t)));
|
|
224
185
|
}
|
|
225
|
-
|
|
226
186
|
var task = tasks[0];
|
|
227
|
-
|
|
228
187
|
if (tasks.length === 1) {
|
|
229
188
|
(0, _utils.check)(task, _utils.is.notUndef, 'cancel(task): argument task is undefined');
|
|
230
|
-
(0, _utils.check)(task, _utils.is.task,
|
|
189
|
+
(0, _utils.check)(task, _utils.is.task, `cancel(task): argument ${task} is not a valid Task object ${TEST_HINT}`);
|
|
231
190
|
}
|
|
232
|
-
|
|
233
191
|
return effect(CANCEL, task || _utils.SELF_CANCELLATION);
|
|
234
192
|
}
|
|
235
|
-
|
|
236
193
|
function select(selector) {
|
|
237
194
|
for (var _len7 = arguments.length, args = new Array(_len7 > 1 ? _len7 - 1 : 0), _key7 = 1; _key7 < _len7; _key7++) {
|
|
238
195
|
args[_key7 - 1] = arguments[_key7];
|
|
239
196
|
}
|
|
240
|
-
|
|
241
197
|
if (arguments.length === 0) {
|
|
242
198
|
selector = _utils.ident;
|
|
243
199
|
} else {
|
|
244
200
|
(0, _utils.check)(selector, _utils.is.notUndef, 'select(selector,[...]): argument selector is undefined');
|
|
245
|
-
(0, _utils.check)(selector, _utils.is.func,
|
|
201
|
+
(0, _utils.check)(selector, _utils.is.func, `select(selector,[...]): argument ${selector} is not a function`);
|
|
246
202
|
}
|
|
247
|
-
|
|
248
203
|
return effect(SELECT, {
|
|
249
|
-
selector
|
|
250
|
-
args
|
|
204
|
+
selector,
|
|
205
|
+
args
|
|
251
206
|
});
|
|
252
207
|
}
|
|
253
|
-
|
|
254
208
|
function selectSelf() {
|
|
255
209
|
return effect(SELECT_SELF, {});
|
|
256
210
|
}
|
|
257
|
-
|
|
258
211
|
function putMutation(fn) {
|
|
259
212
|
return effect(PUT_MUTAION, {
|
|
260
|
-
fn
|
|
213
|
+
fn
|
|
261
214
|
});
|
|
262
215
|
}
|
|
263
|
-
|
|
264
216
|
function putAsyncAction(action) {
|
|
265
217
|
return effect(PUT_ASYNC, {
|
|
266
|
-
action
|
|
218
|
+
action
|
|
267
219
|
});
|
|
268
220
|
}
|
|
221
|
+
|
|
269
222
|
/**
|
|
270
223
|
channel(pattern, [buffer]) => creates an event channel for store actions
|
|
271
224
|
**/
|
|
272
|
-
|
|
273
|
-
|
|
274
225
|
function actionChannel(pattern, buffer) {
|
|
275
226
|
(0, _utils.check)(pattern, _utils.is.notUndef, 'actionChannel(pattern,...): argument pattern is undefined');
|
|
276
|
-
|
|
277
227
|
if (arguments.length > 1) {
|
|
278
228
|
(0, _utils.check)(buffer, _utils.is.notUndef, 'actionChannel(pattern, buffer): argument buffer is undefined');
|
|
279
|
-
(0, _utils.check)(buffer, _utils.is.buffer,
|
|
229
|
+
(0, _utils.check)(buffer, _utils.is.buffer, `actionChannel(pattern, buffer): argument ${buffer} is not a valid buffer`);
|
|
280
230
|
}
|
|
281
|
-
|
|
282
231
|
return effect(ACTION_CHANNEL, {
|
|
283
|
-
pattern
|
|
284
|
-
buffer
|
|
232
|
+
pattern,
|
|
233
|
+
buffer
|
|
285
234
|
});
|
|
286
235
|
}
|
|
287
|
-
|
|
288
236
|
function cancelled() {
|
|
289
237
|
return effect(CANCELLED, {});
|
|
290
238
|
}
|
|
291
|
-
|
|
292
239
|
function flush(channel) {
|
|
293
|
-
(0, _utils.check)(channel, _utils.is.channel,
|
|
240
|
+
(0, _utils.check)(channel, _utils.is.channel, `flush(channel): argument ${channel} is not valid channel`);
|
|
294
241
|
return effect(FLUSH, channel);
|
|
295
242
|
}
|
|
296
|
-
|
|
297
243
|
function getContext(prop) {
|
|
298
|
-
(0, _utils.check)(prop, _utils.is.string,
|
|
244
|
+
(0, _utils.check)(prop, _utils.is.string, `getContext(prop): argument ${prop} is not a string`);
|
|
299
245
|
return effect(GET_CONTEXT, prop);
|
|
300
246
|
}
|
|
301
|
-
|
|
302
247
|
function setContext(props) {
|
|
303
248
|
(0, _utils.check)(props, _utils.is.object, (0, _utils.createSetContextWarning)(null, props));
|
|
304
249
|
return effect(SET_CONTEXT, props);
|
|
305
250
|
}
|
|
306
|
-
|
|
307
|
-
var createAsEffectType = function createAsEffectType(type) {
|
|
308
|
-
return function (effect) {
|
|
309
|
-
return effect && effect[IO] && effect[type];
|
|
310
|
-
};
|
|
311
|
-
};
|
|
312
|
-
|
|
251
|
+
var createAsEffectType = type => effect => effect && effect[IO] && effect[type];
|
|
313
252
|
var asEffect = {
|
|
314
|
-
take:
|
|
315
|
-
put:
|
|
316
|
-
all:
|
|
317
|
-
race:
|
|
318
|
-
call:
|
|
319
|
-
cps:
|
|
320
|
-
fork:
|
|
321
|
-
join:
|
|
322
|
-
cancel:
|
|
323
|
-
select:
|
|
324
|
-
selectSelf:
|
|
325
|
-
putAsyncAction:
|
|
326
|
-
actionChannel:
|
|
327
|
-
cancelled:
|
|
328
|
-
flush:
|
|
329
|
-
getContext:
|
|
330
|
-
setContext:
|
|
331
|
-
putMutation:
|
|
253
|
+
take: createAsEffectType(TAKE),
|
|
254
|
+
put: createAsEffectType(PUT),
|
|
255
|
+
all: createAsEffectType(ALL),
|
|
256
|
+
race: createAsEffectType(RACE),
|
|
257
|
+
call: createAsEffectType(CALL),
|
|
258
|
+
cps: createAsEffectType(CPS),
|
|
259
|
+
fork: createAsEffectType(FORK),
|
|
260
|
+
join: createAsEffectType(JOIN),
|
|
261
|
+
cancel: createAsEffectType(CANCEL),
|
|
262
|
+
select: createAsEffectType(SELECT),
|
|
263
|
+
selectSelf: createAsEffectType(SELECT_SELF),
|
|
264
|
+
putAsyncAction: createAsEffectType(PUT_ASYNC),
|
|
265
|
+
actionChannel: createAsEffectType(ACTION_CHANNEL),
|
|
266
|
+
cancelled: createAsEffectType(CANCELLED),
|
|
267
|
+
flush: createAsEffectType(FLUSH),
|
|
268
|
+
getContext: createAsEffectType(GET_CONTEXT),
|
|
269
|
+
setContext: createAsEffectType(SET_CONTEXT),
|
|
270
|
+
putMutation: createAsEffectType(PUT_MUTAION)
|
|
332
271
|
};
|
|
333
|
-
exports.asEffect = asEffect;
|
|
272
|
+
exports.asEffect = asEffect;
|
|
273
|
+
//# sourceMappingURL=io.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"io.js","names":["_utils","require","IO","sym","TAKE","PUT","ALL","RACE","CALL","CPS","FORK","JOIN","CANCEL","SELECT","SELECT_SELF","PUT_MUTAION","PUT_ASYNC","ACTION_CHANNEL","CANCELLED","FLUSH","GET_CONTEXT","SET_CONTEXT","TEST_HINT","effect","type","payload","detach","eff","check","asEffect","fork","is","object","detached","exports","take","patternOrChannel","arguments","length","undefined","notUndef","pattern","channel","Error","String","maybe","takem","deprecate","updateIncentive","put","action","resolve","sync","all","effects","race","getFnCallDesc","meth","fn","args","context","array","_fn","_fn2","_slicedToArray2","default","_fn3","string","func","call","_len","Array","_key","apply","cps","_len2","_key2","_len3","_key3","spawn","_len4","_key4","join","_len5","tasks","_key5","map","t","task","cancel","_len6","_key6","SELF_CANCELLATION","select","selector","_len7","_key7","ident","selectSelf","putMutation","putAsyncAction","actionChannel","buffer","cancelled","flush","getContext","prop","setContext","props","createSetContextWarning","createAsEffectType"],"sources":["../../io.js"],"sourcesContent":["import { sym, is, ident, check, deprecate, updateIncentive, createSetContextWarning, SELF_CANCELLATION } from './utils'\n\nconst IO = sym('IO')\nconst TAKE = 'TAKE'\nconst PUT = 'PUT'\nconst ALL = 'ALL'\nconst RACE = 'RACE'\nconst CALL = 'CALL'\nconst CPS = 'CPS'\nconst FORK = 'FORK'\nconst JOIN = 'JOIN'\nconst CANCEL = 'CANCEL'\nconst SELECT = 'SELECT'\nconst SELECT_SELF = 'SELECT_SELF'\nconst PUT_MUTAION = 'PUT_MUTATION'\nconst PUT_ASYNC = 'PUT_ASYNC'\nconst ACTION_CHANNEL = 'ACTION_CHANNEL'\nconst CANCELLED = 'CANCELLED'\nconst FLUSH = 'FLUSH'\nconst GET_CONTEXT = 'GET_CONTEXT'\nconst SET_CONTEXT = 'SET_CONTEXT'\n\nconst TEST_HINT =\n '\\n(HINT: if you are getting this errors in tests, consider using createMockTask from redux-saga/utils)'\n\nconst effect = (type, payload) => ({ [IO]: true, [type]: payload })\n\nexport const detach = eff => {\n check(asEffect.fork(eff), is.object, 'detach(eff): argument must be a fork effect')\n eff[FORK].detached = true\n return eff\n}\n\nexport function take(patternOrChannel = '*') {\n if (arguments.length) {\n check(arguments[0], is.notUndef, 'take(patternOrChannel): patternOrChannel is undefined')\n }\n if (is.pattern(patternOrChannel)) {\n return effect(TAKE, { pattern: patternOrChannel })\n }\n if (is.channel(patternOrChannel)) {\n return effect(TAKE, { channel: patternOrChannel })\n }\n throw new Error(\n `take(patternOrChannel): argument ${String(patternOrChannel)} is not valid channel or a valid pattern`,\n )\n}\n\ntake.maybe = (...args) => {\n const eff = take(...args)\n eff[TAKE].maybe = true\n return eff\n}\n\nexport const takem = deprecate(take.maybe, updateIncentive('takem', 'take.maybe'))\n\nexport function put(channel, action) {\n if (arguments.length > 1) {\n check(channel, is.notUndef, 'put(channel, action): argument channel is undefined')\n check(channel, is.channel, `put(channel, action): argument ${channel} is not a valid channel`)\n check(action, is.notUndef, 'put(channel, action): argument action is undefined')\n } else {\n check(channel, is.notUndef, 'put(action): argument action is undefined')\n action = channel\n channel = null\n }\n return effect(PUT, { channel, action })\n}\n\nput.resolve = (...args) => {\n const eff = put(...args)\n eff[PUT].resolve = true\n return eff\n}\n\nput.sync = deprecate(put.resolve, updateIncentive('put.sync', 'put.resolve'))\n\nexport function all(effects) {\n return effect(ALL, effects)\n}\n\nexport function race(effects) {\n return effect(RACE, effects)\n}\n\nfunction getFnCallDesc(meth, fn, args) {\n check(fn, is.notUndef, `${meth}: argument fn is undefined`)\n\n let context = null\n if (is.array(fn)) {\n [context, fn] = fn\n } else if (fn.fn) {\n ({ context, fn } = fn)\n }\n if (context && is.string(fn) && is.func(context[fn])) {\n fn = context[fn]\n }\n check(fn, is.func, `${meth}: argument ${fn} is not a function`)\n\n return { context, fn, args }\n}\n\nexport function call(fn, ...args) {\n return effect(CALL, getFnCallDesc('call', fn, args))\n}\n\nexport function apply(context, fn, args = []) {\n return effect(CALL, getFnCallDesc('apply', { context, fn }, args))\n}\n\nexport function cps(fn, ...args) {\n return effect(CPS, getFnCallDesc('cps', fn, args))\n}\n\nexport function fork(fn, ...args) {\n return effect(FORK, getFnCallDesc('fork', fn, args))\n}\n\nexport function spawn(fn, ...args) {\n return detach(fork(fn, ...args))\n}\n\nexport function join(...tasks) {\n if (tasks.length > 1) {\n return all(tasks.map(t => join(t)))\n }\n const task = tasks[0]\n check(task, is.notUndef, 'join(task): argument task is undefined')\n check(task, is.task, `join(task): argument ${task} is not a valid Task object ${TEST_HINT}`)\n return effect(JOIN, task)\n}\n\nexport function cancel(...tasks) {\n if (tasks.length > 1) {\n return all(tasks.map(t => cancel(t)))\n }\n const task = tasks[0]\n if (tasks.length === 1) {\n check(task, is.notUndef, 'cancel(task): argument task is undefined')\n check(task, is.task, `cancel(task): argument ${task} is not a valid Task object ${TEST_HINT}`)\n }\n return effect(CANCEL, task || SELF_CANCELLATION)\n}\n\nexport function select(selector, ...args) {\n if (arguments.length === 0) {\n selector = ident\n } else {\n check(selector, is.notUndef, 'select(selector,[...]): argument selector is undefined')\n check(selector, is.func, `select(selector,[...]): argument ${selector} is not a function`)\n }\n return effect(SELECT, { selector, args })\n}\n\nexport function selectSelf() {\n return effect(SELECT_SELF, {})\n}\n\nexport function putMutation(fn) {\n return effect(PUT_MUTAION, { fn })\n}\n\nexport function putAsyncAction(action) {\n return effect(PUT_ASYNC, { action })\n}\n\n/**\n channel(pattern, [buffer]) => creates an event channel for store actions\n**/\nexport function actionChannel(pattern, buffer) {\n check(pattern, is.notUndef, 'actionChannel(pattern,...): argument pattern is undefined')\n if (arguments.length > 1) {\n check(buffer, is.notUndef, 'actionChannel(pattern, buffer): argument buffer is undefined')\n check(buffer, is.buffer, `actionChannel(pattern, buffer): argument ${buffer} is not a valid buffer`)\n }\n return effect(ACTION_CHANNEL, { pattern, buffer })\n}\n\nexport function cancelled() {\n return effect(CANCELLED, {})\n}\n\nexport function flush(channel) {\n check(channel, is.channel, `flush(channel): argument ${channel} is not valid channel`)\n return effect(FLUSH, channel)\n}\n\nexport function getContext(prop) {\n check(prop, is.string, `getContext(prop): argument ${prop} is not a string`)\n return effect(GET_CONTEXT, prop)\n}\n\nexport function setContext(props) {\n check(props, is.object, createSetContextWarning(null, props))\n return effect(SET_CONTEXT, props)\n}\n\nconst createAsEffectType = type => effect => effect && effect[IO] && effect[type]\n\nexport const asEffect = {\n take: createAsEffectType(TAKE),\n put: createAsEffectType(PUT),\n all: createAsEffectType(ALL),\n race: createAsEffectType(RACE),\n call: createAsEffectType(CALL),\n cps: createAsEffectType(CPS),\n fork: createAsEffectType(FORK),\n join: createAsEffectType(JOIN),\n cancel: createAsEffectType(CANCEL),\n select: createAsEffectType(SELECT),\n selectSelf: createAsEffectType(SELECT_SELF),\n putAsyncAction: createAsEffectType(PUT_ASYNC),\n actionChannel: createAsEffectType(ACTION_CHANNEL),\n cancelled: createAsEffectType(CANCELLED),\n flush: createAsEffectType(FLUSH),\n getContext: createAsEffectType(GET_CONTEXT),\n setContext: createAsEffectType(SET_CONTEXT),\n putMutation: createAsEffectType(PUT_MUTAION)\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAEA,IAAMC,EAAE,GAAG,IAAAC,UAAG,EAAC,IAAI,CAAC;AACpB,IAAMC,IAAI,GAAG,MAAM;AACnB,IAAMC,GAAG,GAAG,KAAK;AACjB,IAAMC,GAAG,GAAG,KAAK;AACjB,IAAMC,IAAI,GAAG,MAAM;AACnB,IAAMC,IAAI,GAAG,MAAM;AACnB,IAAMC,GAAG,GAAG,KAAK;AACjB,IAAMC,IAAI,GAAG,MAAM;AACnB,IAAMC,IAAI,GAAG,MAAM;AACnB,IAAMC,MAAM,GAAG,QAAQ;AACvB,IAAMC,MAAM,GAAG,QAAQ;AACvB,IAAMC,WAAW,GAAG,aAAa;AACjC,IAAMC,WA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AAC;EACxCsF,KAAK,EAAEM,kBAAkB,CAAC3F,KAAK,CAAC;EAChCsF,UAAU,EAAEK,kBAAkB,CAAC1F,WAAW,CAAC;EAC3CuF,UAAU,EAAEG,kBAAkB,CAACzF,WAAW,CAAC;EAC3C8E,WAAW,EAAEW,kBAAkB,CAAC/F,WAAW;AAC7C,CAAC;AAAAmB,OAAA,CAAAL,QAAA,GAAAA,QAAA"}
|
|
@@ -1,87 +1,82 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
exports
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
var
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
options = _objectWithoutPropertiesLoose(_ref, ["context"]);
|
|
19
|
-
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = sagaMiddlewareFactory;
|
|
8
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
9
|
+
var _utils = require("./utils");
|
|
10
|
+
var _channel = require("./channel");
|
|
11
|
+
var _runSaga = require("./runSaga");
|
|
12
|
+
var _excluded = ["context"];
|
|
13
|
+
function sagaMiddlewareFactory() {
|
|
14
|
+
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
15
|
+
_ref$context = _ref.context,
|
|
16
|
+
context = _ref$context === void 0 ? {} : _ref$context,
|
|
17
|
+
options = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
20
18
|
var sagaMonitor = options.sagaMonitor,
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
logger = options.logger,
|
|
20
|
+
onError = options.onError;
|
|
24
21
|
if (_utils.is.func(options)) {
|
|
25
22
|
if (process.env.NODE_ENV === 'production') {
|
|
26
23
|
throw new Error('Saga middleware no longer accept Generator functions. Use sagaMiddleware.run instead');
|
|
27
24
|
} else {
|
|
28
|
-
throw new Error(
|
|
25
|
+
throw new Error(`You passed a function to the Saga middleware. You are likely trying to start a\
|
|
26
|
+
Saga by directly passing it to the middleware. This is no longer possible starting from 0.10.0.\
|
|
27
|
+
To run a Saga, you must do it dynamically AFTER mounting the middleware into the store.
|
|
28
|
+
Example:
|
|
29
|
+
import createSagaMiddleware from 'redux-saga'
|
|
30
|
+
... other imports
|
|
31
|
+
|
|
32
|
+
const sagaMiddleware = createSagaMiddleware()
|
|
33
|
+
const store = createStore(reducer, applyMiddleware(sagaMiddleware))
|
|
34
|
+
sagaMiddleware.run(saga, ...args)
|
|
35
|
+
`);
|
|
29
36
|
}
|
|
30
37
|
}
|
|
31
|
-
|
|
32
38
|
if (logger && !_utils.is.func(logger)) {
|
|
33
39
|
throw new Error('`options.logger` passed to the Saga middleware is not a function!');
|
|
34
40
|
}
|
|
35
|
-
|
|
36
41
|
if (process.env.NODE_ENV === 'development' && options.onerror) {
|
|
37
42
|
throw new Error('`options.onerror` was removed. Use `options.onError` instead.');
|
|
38
43
|
}
|
|
39
|
-
|
|
40
44
|
if (onError && !_utils.is.func(onError)) {
|
|
41
45
|
throw new Error('`options.onError` passed to the Saga middleware is not a function!');
|
|
42
46
|
}
|
|
43
|
-
|
|
44
47
|
if (options.emitter && !_utils.is.func(options.emitter)) {
|
|
45
48
|
throw new Error('`options.emitter` passed to the Saga middleware is not a function!');
|
|
46
49
|
}
|
|
47
|
-
|
|
48
50
|
function sagaMiddleware(_ref2) {
|
|
49
51
|
var getState = _ref2.getState,
|
|
50
|
-
|
|
52
|
+
dispatch = _ref2.dispatch;
|
|
51
53
|
var sagaEmitter = (0, _channel.emitter)();
|
|
52
54
|
sagaEmitter.emit = (options.emitter || _utils.ident)(sagaEmitter.emit);
|
|
53
55
|
sagaMiddleware.run = _runSaga.runSaga.bind(null, {
|
|
54
|
-
context
|
|
56
|
+
context,
|
|
55
57
|
subscribe: sagaEmitter.subscribe,
|
|
56
|
-
dispatch
|
|
57
|
-
getState
|
|
58
|
-
sagaMonitor
|
|
59
|
-
logger
|
|
60
|
-
onError
|
|
58
|
+
dispatch,
|
|
59
|
+
getState,
|
|
60
|
+
sagaMonitor,
|
|
61
|
+
logger,
|
|
62
|
+
onError
|
|
61
63
|
});
|
|
62
|
-
return
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
sagaEmitter.emit(action);
|
|
71
|
-
return result;
|
|
72
|
-
};
|
|
64
|
+
return next => action => {
|
|
65
|
+
if (sagaMonitor && sagaMonitor.actionDispatched) {
|
|
66
|
+
sagaMonitor.actionDispatched(action);
|
|
67
|
+
}
|
|
68
|
+
var result = next(action); // hit reducers
|
|
69
|
+
sagaEmitter.emit(action);
|
|
70
|
+
return result;
|
|
73
71
|
};
|
|
74
72
|
}
|
|
75
|
-
|
|
76
|
-
sagaMiddleware.run = function () {
|
|
73
|
+
sagaMiddleware.run = () => {
|
|
77
74
|
throw new Error('Before running a Saga, you must mount the Saga middleware on the Store using applyMiddleware');
|
|
78
75
|
};
|
|
79
|
-
|
|
80
|
-
sagaMiddleware.setContext = function (props) {
|
|
76
|
+
sagaMiddleware.setContext = props => {
|
|
81
77
|
(0, _utils.check)(props, _utils.is.object, (0, _utils.createSetContextWarning)('sagaMiddleware', props));
|
|
82
|
-
|
|
83
78
|
_utils.object.assign(context, props);
|
|
84
79
|
};
|
|
85
|
-
|
|
86
80
|
return sagaMiddleware;
|
|
87
|
-
}
|
|
81
|
+
}
|
|
82
|
+
//# sourceMappingURL=middleware.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"middleware.js","names":["_utils","require","_channel","_runSaga","_excluded","sagaMiddlewareFactory","_ref","arguments","length","undefined","_ref$context","context","options","_objectWithoutProperties2","default","sagaMonitor","logger","onError","is","func","process","env","NODE_ENV","Error","onerror","emitter","sagaMiddleware","_ref2","getState","dispatch","sagaEmitter","emit","ident","run","runSaga","bind","subscribe","next","action","actionDispatched","result","setContext","props","check","object","createSetContextWarning","assign"],"sources":["../../middleware.js"],"sourcesContent":["import { is, check, object, createSetContextWarning } from './utils'\nimport { emitter } from './channel'\nimport { ident } from './utils'\nimport { runSaga } from './runSaga'\n\nexport default function sagaMiddlewareFactory({ context = {}, ...options } = {}) {\n const { sagaMonitor, logger, onError } = options\n\n if (is.func(options)) {\n if (process.env.NODE_ENV === 'production') {\n throw new Error('Saga middleware no longer accept Generator functions. Use sagaMiddleware.run instead')\n } else {\n throw new Error(\n `You passed a function to the Saga middleware. You are likely trying to start a\\\n Saga by directly passing it to the middleware. This is no longer possible starting from 0.10.0.\\\n To run a Saga, you must do it dynamically AFTER mounting the middleware into the store.\n Example:\n import createSagaMiddleware from 'redux-saga'\n ... other imports\n\n const sagaMiddleware = createSagaMiddleware()\n const store = createStore(reducer, applyMiddleware(sagaMiddleware))\n sagaMiddleware.run(saga, ...args)\n `,\n )\n }\n }\n\n if (logger && !is.func(logger)) {\n throw new Error('`options.logger` passed to the Saga middleware is not a function!')\n }\n\n if (process.env.NODE_ENV === 'development' && options.onerror) {\n throw new Error('`options.onerror` was removed. Use `options.onError` instead.')\n }\n\n if (onError && !is.func(onError)) {\n throw new Error('`options.onError` passed to the Saga middleware is not a function!')\n }\n\n if (options.emitter && !is.func(options.emitter)) {\n throw new Error('`options.emitter` passed to the Saga middleware is not a function!')\n }\n\n function sagaMiddleware({ getState, dispatch }) {\n const sagaEmitter = emitter()\n sagaEmitter.emit = (options.emitter || ident)(sagaEmitter.emit)\n\n sagaMiddleware.run = runSaga.bind(null, {\n context,\n subscribe: sagaEmitter.subscribe,\n dispatch,\n getState,\n sagaMonitor,\n logger,\n onError,\n })\n\n return next => action => {\n if (sagaMonitor && sagaMonitor.actionDispatched) {\n sagaMonitor.actionDispatched(action)\n }\n const result = next(action) // hit reducers\n sagaEmitter.emit(action)\n return result\n }\n }\n\n sagaMiddleware.run = () => {\n throw new Error('Before running a Saga, you must mount the Saga middleware on the Store using applyMiddleware')\n }\n\n sagaMiddleware.setContext = props => {\n check(props, is.object, createSetContextWarning('sagaMiddleware', props))\n object.assign(context, props)\n }\n\n return sagaMiddleware\n}\n"],"mappings":";;;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAEA,IAAAE,QAAA,GAAAF,OAAA;AAAmC,IAAAG,SAAA;AAEpB,SAASC,qBAAqBA,CAAA,EAAoC;EAAA,IAAAC,IAAA,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAJ,CAAC,CAAC;IAAAG,YAAA,GAAAJ,IAAA,CAA/BK,OAAO;IAAPA,OAAO,GAAAD,YAAA,cAAG,CAAC,CAAC,GAAAA,YAAA;IAAKE,OAAO,OAAAC,yBAAA,CAAAC,OAAA,EAAAR,IAAA,EAAAF,SAAA;EACtE,IAAQW,WAAW,GAAsBH,OAAO,CAAxCG,WAAW;IAAEC,MAAM,GAAcJ,OAAO,CAA3BI,MAAM;IAAEC,OAAO,GAAKL,OAAO,CAAnBK,OAAO;EAEpC,IAAIC,SAAE,CAACC,IAAI,CAACP,OAAO,CAAC,EAAE;IACpB,IAAIQ,OAAO,CAACC,GAAG,CAACC,QAAQ,KAAK,YAAY,EAAE;MACzC,MAAM,IAAIC,KAAK,CAAC,sFAAsF,CAAC;IACzG,CAAC,MAAM;MACL,MAAM,IAAIA,KAAK,CACZ;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,CACA;IACH;EACF;EAEA,IAAIP,MAAM,IAAI,CAACE,SAAE,CAACC,IAAI,CAACH,MAAM,CAAC,EAAE;IAC9B,MAAM,IAAIO,KAAK,CAAC,mEAAmE,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