@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
package/lib/internal/utils.js
CHANGED
|
@@ -1,128 +1,83 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.array = exports.TASK = exports.SELF_CANCELLATION = exports.SAGA_ACTION = exports.MATCH = exports.HELPER = exports.CANCEL = void 0;
|
|
8
|
+
exports.arrayOfDeffered = arrayOfDeffered;
|
|
9
|
+
exports.autoInc = autoInc;
|
|
4
10
|
exports.check = check;
|
|
5
|
-
exports.
|
|
6
|
-
exports.
|
|
11
|
+
exports.cloneableGenerator = void 0;
|
|
12
|
+
exports.createMockTask = createMockTask;
|
|
13
|
+
exports.createSetContextWarning = void 0;
|
|
7
14
|
exports.deferred = deferred;
|
|
8
|
-
exports.arrayOfDeffered = arrayOfDeffered;
|
|
9
15
|
exports.delay = delay;
|
|
10
|
-
exports.createMockTask = createMockTask;
|
|
11
|
-
exports.autoInc = autoInc;
|
|
12
|
-
exports.makeIterator = makeIterator;
|
|
13
|
-
exports.log = log;
|
|
14
16
|
exports.deprecate = deprecate;
|
|
15
|
-
exports.
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
17
|
+
exports.hasOwn = hasOwn;
|
|
18
|
+
exports.konst = exports.kTrue = exports.kFalse = exports.is = exports.internalErr = exports.ident = void 0;
|
|
19
|
+
exports.log = log;
|
|
20
|
+
exports.makeIterator = makeIterator;
|
|
21
|
+
exports.object = exports.noop = void 0;
|
|
22
|
+
exports.remove = remove;
|
|
23
|
+
exports.wrapSagaDispatch = exports.updateIncentive = exports.uid = exports.sym = void 0;
|
|
24
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
25
|
+
var sym = id => `@@redux-saga/${id}`;
|
|
23
26
|
exports.sym = sym;
|
|
24
|
-
var TASK =
|
|
27
|
+
var TASK = sym('TASK');
|
|
25
28
|
exports.TASK = TASK;
|
|
26
|
-
var HELPER =
|
|
29
|
+
var HELPER = sym('HELPER');
|
|
27
30
|
exports.HELPER = HELPER;
|
|
28
|
-
var MATCH =
|
|
31
|
+
var MATCH = sym('MATCH');
|
|
29
32
|
exports.MATCH = MATCH;
|
|
30
|
-
var CANCEL =
|
|
33
|
+
var CANCEL = sym('CANCEL_PROMISE');
|
|
31
34
|
exports.CANCEL = CANCEL;
|
|
32
|
-
var SAGA_ACTION =
|
|
35
|
+
var SAGA_ACTION = sym('SAGA_ACTION');
|
|
33
36
|
exports.SAGA_ACTION = SAGA_ACTION;
|
|
34
|
-
var SELF_CANCELLATION =
|
|
37
|
+
var SELF_CANCELLATION = sym('SELF_CANCELLATION');
|
|
35
38
|
exports.SELF_CANCELLATION = SELF_CANCELLATION;
|
|
36
|
-
|
|
37
|
-
var konst = function konst(v) {
|
|
38
|
-
return function () {
|
|
39
|
-
return v;
|
|
40
|
-
};
|
|
41
|
-
};
|
|
42
|
-
|
|
39
|
+
var konst = v => () => v;
|
|
43
40
|
exports.konst = konst;
|
|
44
|
-
var kTrue =
|
|
41
|
+
var kTrue = konst(true);
|
|
45
42
|
exports.kTrue = kTrue;
|
|
46
|
-
var kFalse =
|
|
43
|
+
var kFalse = konst(false);
|
|
47
44
|
exports.kFalse = kFalse;
|
|
48
|
-
|
|
49
|
-
var noop = function noop() {};
|
|
50
|
-
|
|
45
|
+
var noop = () => {};
|
|
51
46
|
exports.noop = noop;
|
|
52
|
-
|
|
53
|
-
var ident = function ident(v) {
|
|
54
|
-
return v;
|
|
55
|
-
};
|
|
56
|
-
|
|
47
|
+
var ident = v => v;
|
|
57
48
|
exports.ident = ident;
|
|
58
|
-
|
|
59
49
|
function check(value, predicate, error) {
|
|
60
50
|
if (!predicate(value)) {
|
|
61
51
|
log('error', 'uncaught at check', error);
|
|
62
52
|
throw new Error(error);
|
|
63
53
|
}
|
|
64
54
|
}
|
|
65
|
-
|
|
66
55
|
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
67
|
-
|
|
68
56
|
function hasOwn(object, property) {
|
|
69
57
|
return is.notUndef(object) && hasOwnProperty.call(object, property);
|
|
70
58
|
}
|
|
71
|
-
|
|
72
59
|
var is = {
|
|
73
|
-
undef:
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
},
|
|
79
|
-
func: function func(f) {
|
|
80
|
-
return typeof f === 'function';
|
|
81
|
-
},
|
|
82
|
-
number: function number(n) {
|
|
83
|
-
return typeof n === 'number';
|
|
84
|
-
},
|
|
85
|
-
string: function string(s) {
|
|
86
|
-
return typeof s === 'string';
|
|
87
|
-
},
|
|
60
|
+
undef: v => v === null || v === undefined,
|
|
61
|
+
notUndef: v => v !== null && v !== undefined,
|
|
62
|
+
func: f => typeof f === 'function',
|
|
63
|
+
number: n => typeof n === 'number',
|
|
64
|
+
string: s => typeof s === 'string',
|
|
88
65
|
array: Array.isArray,
|
|
89
|
-
object:
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
},
|
|
101
|
-
task: function task(t) {
|
|
102
|
-
return t && t[TASK];
|
|
103
|
-
},
|
|
104
|
-
observable: function observable(ob) {
|
|
105
|
-
return ob && is.func(ob.subscribe);
|
|
106
|
-
},
|
|
107
|
-
buffer: function buffer(buf) {
|
|
108
|
-
return buf && is.func(buf.isEmpty) && is.func(buf.take) && is.func(buf.put);
|
|
109
|
-
},
|
|
110
|
-
pattern: function pattern(pat) {
|
|
111
|
-
return pat && (is.string(pat) || typeof pat === 'symbol' || is.func(pat) || is.array(pat));
|
|
112
|
-
},
|
|
113
|
-
channel: function channel(ch) {
|
|
114
|
-
return ch && is.func(ch.take) && is.func(ch.close);
|
|
115
|
-
},
|
|
116
|
-
helper: function helper(it) {
|
|
117
|
-
return it && it[HELPER];
|
|
118
|
-
},
|
|
119
|
-
stringableFunc: function stringableFunc(f) {
|
|
120
|
-
return is.func(f) && hasOwn(f, 'toString');
|
|
121
|
-
}
|
|
66
|
+
object: obj => obj && !is.array(obj) && typeof obj === 'object',
|
|
67
|
+
promise: p => p && is.func(p.then),
|
|
68
|
+
iterator: it => it && is.func(it.next) && is.func(it.throw),
|
|
69
|
+
iterable: it => it && is.func(Symbol) ? is.func(it[Symbol.iterator]) : is.array(it),
|
|
70
|
+
task: t => t && t[TASK],
|
|
71
|
+
observable: ob => ob && is.func(ob.subscribe),
|
|
72
|
+
buffer: buf => buf && is.func(buf.isEmpty) && is.func(buf.take) && is.func(buf.put),
|
|
73
|
+
pattern: pat => pat && (is.string(pat) || typeof pat === 'symbol' || is.func(pat) || is.array(pat)),
|
|
74
|
+
channel: ch => ch && is.func(ch.take) && is.func(ch.close),
|
|
75
|
+
helper: it => it && it[HELPER],
|
|
76
|
+
stringableFunc: f => is.func(f) && hasOwn(f, 'toString')
|
|
122
77
|
};
|
|
123
78
|
exports.is = is;
|
|
124
79
|
var object = {
|
|
125
|
-
assign
|
|
80
|
+
assign(target, source) {
|
|
126
81
|
for (var i in source) {
|
|
127
82
|
if (hasOwn(source, i)) {
|
|
128
83
|
target[i] = source[i];
|
|
@@ -131,231 +86,148 @@ var object = {
|
|
|
131
86
|
}
|
|
132
87
|
};
|
|
133
88
|
exports.object = object;
|
|
134
|
-
|
|
135
89
|
function remove(array, item) {
|
|
136
90
|
var index = array.indexOf(item);
|
|
137
|
-
|
|
138
91
|
if (index >= 0) {
|
|
139
92
|
array.splice(index, 1);
|
|
140
93
|
}
|
|
141
94
|
}
|
|
142
|
-
|
|
143
95
|
var array = {
|
|
144
|
-
from
|
|
96
|
+
from(obj) {
|
|
145
97
|
var arr = Array(obj.length);
|
|
146
|
-
|
|
147
98
|
for (var i in obj) {
|
|
148
99
|
if (hasOwn(obj, i)) {
|
|
149
100
|
arr[i] = obj[i];
|
|
150
101
|
}
|
|
151
102
|
}
|
|
152
|
-
|
|
153
103
|
return arr;
|
|
154
104
|
}
|
|
155
105
|
};
|
|
156
106
|
exports.array = array;
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
var def = _extends({}, props);
|
|
164
|
-
|
|
165
|
-
var promise = new Promise(function (resolve, reject) {
|
|
107
|
+
function deferred() {
|
|
108
|
+
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
109
|
+
var def = (0, _objectSpread2.default)({}, props);
|
|
110
|
+
var promise = new Promise((resolve, reject) => {
|
|
166
111
|
def.resolve = resolve;
|
|
167
112
|
def.reject = reject;
|
|
168
113
|
});
|
|
169
114
|
def.promise = promise;
|
|
170
115
|
return def;
|
|
171
116
|
}
|
|
172
|
-
|
|
173
117
|
function arrayOfDeffered(length) {
|
|
174
118
|
var arr = [];
|
|
175
|
-
|
|
176
119
|
for (var i = 0; i < length; i++) {
|
|
177
120
|
arr.push(deferred());
|
|
178
121
|
}
|
|
179
|
-
|
|
180
122
|
return arr;
|
|
181
123
|
}
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
if (val === void 0) {
|
|
185
|
-
val = true;
|
|
186
|
-
}
|
|
187
|
-
|
|
124
|
+
function delay(ms) {
|
|
125
|
+
var val = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
188
126
|
var timeoutId;
|
|
189
|
-
var promise = new Promise(
|
|
190
|
-
timeoutId = setTimeout(
|
|
191
|
-
return resolve(val);
|
|
192
|
-
}, ms);
|
|
127
|
+
var promise = new Promise(resolve => {
|
|
128
|
+
timeoutId = setTimeout(() => resolve(val), ms);
|
|
193
129
|
});
|
|
194
|
-
|
|
195
|
-
promise[CANCEL] = function () {
|
|
196
|
-
return clearTimeout(timeoutId);
|
|
197
|
-
};
|
|
198
|
-
|
|
130
|
+
promise[CANCEL] = () => clearTimeout(timeoutId);
|
|
199
131
|
return promise;
|
|
200
132
|
}
|
|
201
|
-
|
|
202
133
|
function createMockTask() {
|
|
203
|
-
var _ref;
|
|
204
|
-
|
|
205
134
|
var running = true;
|
|
206
|
-
|
|
207
135
|
var _result, _error;
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
return running = b;
|
|
217
|
-
}, _ref.setResult = function setResult(r) {
|
|
218
|
-
return _result = r;
|
|
219
|
-
}, _ref.setError = function setError(e) {
|
|
220
|
-
return _error = e;
|
|
221
|
-
}, _ref;
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
function autoInc(seed) {
|
|
225
|
-
if (seed === void 0) {
|
|
226
|
-
seed = 0;
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
return function () {
|
|
230
|
-
return ++seed;
|
|
136
|
+
return {
|
|
137
|
+
[TASK]: true,
|
|
138
|
+
isRunning: () => running,
|
|
139
|
+
result: () => _result,
|
|
140
|
+
error: () => _error,
|
|
141
|
+
setRunning: b => running = b,
|
|
142
|
+
setResult: r => _result = r,
|
|
143
|
+
setError: e => _error = e
|
|
231
144
|
};
|
|
232
145
|
}
|
|
233
|
-
|
|
234
|
-
var
|
|
146
|
+
function autoInc() {
|
|
147
|
+
var seed = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
148
|
+
return () => ++seed;
|
|
149
|
+
}
|
|
150
|
+
var uid = autoInc();
|
|
235
151
|
exports.uid = uid;
|
|
236
|
-
|
|
237
|
-
var kThrow = function kThrow(err) {
|
|
152
|
+
var kThrow = err => {
|
|
238
153
|
throw err;
|
|
239
154
|
};
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
function makeIterator(next, thro, name, isHelper) {
|
|
249
|
-
if (thro === void 0) {
|
|
250
|
-
thro = kThrow;
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
if (name === void 0) {
|
|
254
|
-
name = '';
|
|
255
|
-
}
|
|
256
|
-
|
|
155
|
+
var kReturn = value => ({
|
|
156
|
+
value,
|
|
157
|
+
done: true
|
|
158
|
+
});
|
|
159
|
+
function makeIterator(next) {
|
|
160
|
+
var thro = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : kThrow;
|
|
161
|
+
var name = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
|
|
162
|
+
var isHelper = arguments.length > 3 ? arguments[3] : undefined;
|
|
257
163
|
var iterator = {
|
|
258
|
-
name
|
|
259
|
-
next
|
|
260
|
-
|
|
261
|
-
|
|
164
|
+
name,
|
|
165
|
+
next,
|
|
166
|
+
throw: thro,
|
|
167
|
+
return: kReturn
|
|
262
168
|
};
|
|
263
|
-
|
|
264
169
|
if (isHelper) {
|
|
265
170
|
iterator[HELPER] = true;
|
|
266
171
|
}
|
|
267
|
-
|
|
268
172
|
if (typeof Symbol !== 'undefined') {
|
|
269
|
-
iterator[Symbol.iterator] =
|
|
270
|
-
return iterator;
|
|
271
|
-
};
|
|
173
|
+
iterator[Symbol.iterator] = () => iterator;
|
|
272
174
|
}
|
|
273
|
-
|
|
274
175
|
return iterator;
|
|
275
176
|
}
|
|
177
|
+
|
|
276
178
|
/**
|
|
277
179
|
Print error in a useful way whether in a browser environment
|
|
278
180
|
(with expandable error stack traces), or in a node.js environment
|
|
279
181
|
(text-only log output)
|
|
280
182
|
**/
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
function log(level, message, error) {
|
|
284
|
-
if (error === void 0) {
|
|
285
|
-
error = '';
|
|
286
|
-
}
|
|
287
|
-
|
|
183
|
+
function log(level, message) {
|
|
184
|
+
var error = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
|
|
288
185
|
/*eslint-disable no-console*/
|
|
289
186
|
if (typeof window === 'undefined') {
|
|
290
|
-
console.log(
|
|
187
|
+
console.log(`redux-saga ${level}: ${message}\n${error && error.stack || error}`);
|
|
291
188
|
} else {
|
|
292
189
|
console[level](message, error);
|
|
293
190
|
}
|
|
294
191
|
}
|
|
295
|
-
|
|
296
192
|
function deprecate(fn, deprecationWarning) {
|
|
297
193
|
return function () {
|
|
298
194
|
if (process.env.NODE_ENV === 'development') log('warn', deprecationWarning);
|
|
299
|
-
return fn
|
|
195
|
+
return fn(...arguments);
|
|
300
196
|
};
|
|
301
197
|
}
|
|
302
|
-
|
|
303
|
-
var updateIncentive = function updateIncentive(deprecated, preferred) {
|
|
304
|
-
return deprecated + " has been deprecated in favor of " + preferred + ", please update your code";
|
|
305
|
-
};
|
|
306
|
-
|
|
198
|
+
var updateIncentive = (deprecated, preferred) => `${deprecated} has been deprecated in favor of ${preferred}, please update your code`;
|
|
307
199
|
exports.updateIncentive = updateIncentive;
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
}
|
|
312
|
-
|
|
200
|
+
var internalErr = err => new Error(`
|
|
201
|
+
redux-saga: Error checking hooks detected an inconsistent state. This is likely a bug
|
|
202
|
+
in redux-saga code and not yours. Thanks for reporting this in the project's github repo.
|
|
203
|
+
Error: ${err}
|
|
204
|
+
`);
|
|
313
205
|
exports.internalErr = internalErr;
|
|
314
|
-
|
|
315
|
-
var createSetContextWarning = function createSetContextWarning(ctx, props) {
|
|
316
|
-
return (ctx ? ctx + '.' : '') + "setContext(props): argument " + props + " is not a plain object";
|
|
317
|
-
};
|
|
318
|
-
|
|
206
|
+
var createSetContextWarning = (ctx, props) => `${ctx ? ctx + '.' : ''}setContext(props): argument ${props} is not a plain object`;
|
|
319
207
|
exports.createSetContextWarning = createSetContextWarning;
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
return dispatch(Object.defineProperty(action, SAGA_ACTION, {
|
|
324
|
-
value: true
|
|
325
|
-
}));
|
|
326
|
-
};
|
|
327
|
-
};
|
|
328
|
-
|
|
208
|
+
var wrapSagaDispatch = dispatch => action => dispatch(Object.defineProperty(action, SAGA_ACTION, {
|
|
209
|
+
value: true
|
|
210
|
+
}));
|
|
329
211
|
exports.wrapSagaDispatch = wrapSagaDispatch;
|
|
330
|
-
|
|
331
|
-
var
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
});
|
|
349
|
-
return clonedGen;
|
|
350
|
-
},
|
|
351
|
-
"return": function _return(value) {
|
|
352
|
-
return gen["return"](value);
|
|
353
|
-
},
|
|
354
|
-
"throw": function _throw(exception) {
|
|
355
|
-
return gen["throw"](exception);
|
|
356
|
-
}
|
|
357
|
-
};
|
|
212
|
+
var cloneableGenerator = generatorFunc => function () {
|
|
213
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
214
|
+
args[_key] = arguments[_key];
|
|
215
|
+
}
|
|
216
|
+
var history = [];
|
|
217
|
+
var gen = generatorFunc(...args);
|
|
218
|
+
return {
|
|
219
|
+
next: arg => {
|
|
220
|
+
history.push(arg);
|
|
221
|
+
return gen.next(arg);
|
|
222
|
+
},
|
|
223
|
+
clone: () => {
|
|
224
|
+
var clonedGen = cloneableGenerator(generatorFunc)(...args);
|
|
225
|
+
history.forEach(arg => clonedGen.next(arg));
|
|
226
|
+
return clonedGen;
|
|
227
|
+
},
|
|
228
|
+
return: value => gen.return(value),
|
|
229
|
+
throw: exception => gen.throw(exception)
|
|
358
230
|
};
|
|
359
231
|
};
|
|
360
|
-
|
|
361
|
-
|
|
232
|
+
exports.cloneableGenerator = cloneableGenerator;
|
|
233
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","names":["sym","id","exports","TASK","HELPER","MATCH","CANCEL","SAGA_ACTION","SELF_CANCELLATION","konst","v","kTrue","kFalse","noop","ident","check","value","predicate","error","log","Error","hasOwnProperty","Object","prototype","hasOwn","object","property","is","notUndef","call","undef","undefined","func","f","number","n","string","s","array","Array","isArray","obj","promise","p","then","iterator","it","next","throw","iterable","Symbol","task","t","observable","ob","subscribe","buffer","buf","isEmpty","take","put","pattern","pat","channel","ch","close","helper","stringableFunc","assign","target","source","i","remove","item","index","indexOf","splice","from","arr","length","deferred","props","arguments","def","_objectSpread2","default","Promise","resolve","reject","arrayOfDeffered","push","delay","ms","val","timeoutId","setTimeout","clearTimeout","createMockTask","running","result","isRunning","setRunning","b","setResult","r","setError","e","autoInc","seed","uid","kThrow","err","kReturn","done","makeIterator","thro","name","isHelper","return","level","message","window","console","stack","deprecate","fn","deprecationWarning","process","env","NODE_ENV","updateIncentive","deprecated","preferred","internalErr","createSetContextWarning","ctx","wrapSagaDispatch","dispatch","action","defineProperty","cloneableGenerator","generatorFunc","_len","args","_key","history","gen","arg","clone","clonedGen","forEach","exception"],"sources":["../../utils.js"],"sourcesContent":["export const sym = id => `@@redux-saga/${id}`\n\nexport const TASK = sym('TASK')\nexport const HELPER = sym('HELPER')\nexport const MATCH = sym('MATCH')\nexport const CANCEL = sym('CANCEL_PROMISE')\nexport const SAGA_ACTION = sym('SAGA_ACTION')\nexport const SELF_CANCELLATION = sym('SELF_CANCELLATION')\nexport const konst = v => () => v\nexport const kTrue = konst(true)\nexport const kFalse = konst(false)\nexport const noop = () => {}\nexport const ident = v => v\n\nexport function check(value, predicate, error) {\n if (!predicate(value)) {\n log('error', 'uncaught at check', error)\n throw new Error(error)\n }\n}\n\nconst hasOwnProperty = Object.prototype.hasOwnProperty\nexport function hasOwn(object, property) {\n return is.notUndef(object) && hasOwnProperty.call(object, property)\n}\n\nexport const is = {\n undef: v => v === null || v === undefined,\n notUndef: v => v !== null && v !== undefined,\n func: f => typeof f === 'function',\n number: n => typeof n === 'number',\n string: s => typeof s === 'string',\n array: Array.isArray,\n object: obj => obj && !is.array(obj) && typeof obj === 'object',\n promise: p => p && is.func(p.then),\n iterator: it => it && is.func(it.next) && is.func(it.throw),\n iterable: it => (it && is.func(Symbol) ? is.func(it[Symbol.iterator]) : is.array(it)),\n task: t => t && t[TASK],\n observable: ob => ob && is.func(ob.subscribe),\n buffer: buf => buf && is.func(buf.isEmpty) && is.func(buf.take) && is.func(buf.put),\n pattern: pat => pat && (is.string(pat) || typeof pat === 'symbol' || is.func(pat) || is.array(pat)),\n channel: ch => ch && is.func(ch.take) && is.func(ch.close),\n helper: it => it && it[HELPER],\n stringableFunc: f => is.func(f) && hasOwn(f, 'toString'),\n}\n\nexport const object = {\n assign(target, source) {\n for (let i in source) {\n if (hasOwn(source, i)) {\n target[i] = source[i]\n }\n }\n },\n}\n\nexport function remove(array, item) {\n const index = array.indexOf(item)\n if (index >= 0) {\n array.splice(index, 1)\n }\n}\n\nexport const array = {\n from(obj) {\n const arr = Array(obj.length)\n for (let i in obj) {\n if (hasOwn(obj, i)) {\n arr[i] = obj[i]\n }\n }\n return arr\n },\n}\n\nexport function deferred(props = {}) {\n let def = { ...props }\n const promise = new Promise((resolve, reject) => {\n def.resolve = resolve\n def.reject = reject\n })\n def.promise = promise\n return def\n}\n\nexport function arrayOfDeffered(length) {\n const arr = []\n for (let i = 0; i < length; i++) {\n arr.push(deferred())\n }\n return arr\n}\n\nexport function delay(ms, val = true) {\n let timeoutId\n const promise = new Promise(resolve => {\n timeoutId = setTimeout(() => resolve(val), ms)\n })\n\n promise[CANCEL] = () => clearTimeout(timeoutId)\n\n return promise\n}\n\nexport function createMockTask() {\n let running = true\n let result, error\n\n return {\n [TASK]: true,\n isRunning: () => running,\n result: () => result,\n error: () => error,\n\n setRunning: b => (running = b),\n setResult: r => (result = r),\n setError: e => (error = e),\n }\n}\n\nexport function autoInc(seed = 0) {\n return () => ++seed\n}\n\nexport const uid = autoInc()\n\nconst kThrow = err => {\n throw err\n}\nconst kReturn = value => ({ value, done: true })\nexport function makeIterator(next, thro = kThrow, name = '', isHelper) {\n const iterator = { name, next, throw: thro, return: kReturn }\n\n if (isHelper) {\n iterator[HELPER] = true\n }\n if (typeof Symbol !== 'undefined') {\n iterator[Symbol.iterator] = () => iterator\n }\n return iterator\n}\n\n/**\n Print error in a useful way whether in a browser environment\n (with expandable error stack traces), or in a node.js environment\n (text-only log output)\n **/\nexport function log(level, message, error = '') {\n /*eslint-disable no-console*/\n if (typeof window === 'undefined') {\n console.log(`redux-saga ${level}: ${message}\\n${(error && error.stack) || error}`)\n } else {\n console[level](message, error)\n }\n}\n\nexport function deprecate(fn, deprecationWarning) {\n return (...args) => {\n if (process.env.NODE_ENV === 'development') log('warn', deprecationWarning)\n return fn(...args)\n }\n}\n\nexport const updateIncentive = (deprecated, preferred) =>\n `${deprecated} has been deprecated in favor of ${preferred}, please update your code`\n\nexport const internalErr = err =>\n new Error(\n `\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: ${err}\n`,\n )\n\nexport const createSetContextWarning = (ctx, props) =>\n `${ctx ? ctx + '.' : ''}setContext(props): argument ${props} is not a plain object`\n\nexport const wrapSagaDispatch = dispatch => action =>\n dispatch(Object.defineProperty(action, SAGA_ACTION, { value: true }))\n\nexport const cloneableGenerator = generatorFunc => (...args) => {\n const history = []\n const gen = generatorFunc(...args)\n return {\n next: arg => {\n history.push(arg)\n return gen.next(arg)\n },\n clone: () => {\n const clonedGen = cloneableGenerator(generatorFunc)(...args)\n history.forEach(arg => clonedGen.next(arg))\n return clonedGen\n },\n return: value => gen.return(value),\n throw: exception => gen.throw(exception),\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAO,IAAMA,GAAG,GAAGC,EAAE,IAAK,gBAAeA,EAAG,EAAC;AAAAC,OAAA,CAAAF,GAAA,GAAAA,GAAA;AAEtC,IAAMG,IAAI,GAAGH,GAAG,CAAC,MAAM,CAAC;AAAAE,OAAA,CAAAC,IAAA,GAAAA,IAAA;AACxB,IAAMC,MAAM,GAAGJ,GAAG,CAAC,QAAQ,CAAC;AAAAE,OAAA,CAAAE,MAAA,GAAAA,MAAA;AAC5B,IAAMC,KAAK,GAAGL,GAAG,CAAC,OAAO,CAAC;AAAAE,OAAA,CAAAG,KAAA,GAAAA,KAAA;AAC1B,IAAMC,MAAM,GAAGN,GAAG,CAAC,gBAAgB,CAAC;AAAAE,OAAA,CAAAI,MAAA,GAAAA,M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AAS,CAACtG,IAAI,CAACoG,GAAG,CAAC,CAAC;MAC3C,OAAOE,SAAS;IAClB,CAAC;IACD/B,MAAM,EAAEtG,KAAK,IAAIkI,GAAG,CAAC5B,MAAM,CAACtG,KAAK,CAAC;IAClCgC,KAAK,EAAEuG,SAAS,IAAIL,GAAG,CAAClG,KAAK,CAACuG,SAAS;EACzC,CAAC;AACH,CAAC;AAAArJ,OAAA,CAAA0I,kBAAA,GAAAA,kBAAA"}
|
package/lib/utils.js
CHANGED
|
@@ -1,27 +1,74 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
exports
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
exports
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "CHANNEL_END", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function get() {
|
|
9
|
+
return _proc.CHANNEL_END;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "SAGA_ACTION", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function get() {
|
|
15
|
+
return _utils.SAGA_ACTION;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(exports, "TASK", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function get() {
|
|
21
|
+
return _utils.TASK;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
Object.defineProperty(exports, "arrayOfDeffered", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function get() {
|
|
27
|
+
return _utils.arrayOfDeffered;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
Object.defineProperty(exports, "asEffect", {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
get: function get() {
|
|
33
|
+
return _io.asEffect;
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
Object.defineProperty(exports, "cloneableGenerator", {
|
|
37
|
+
enumerable: true,
|
|
38
|
+
get: function get() {
|
|
39
|
+
return _utils.cloneableGenerator;
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
Object.defineProperty(exports, "createMockTask", {
|
|
43
|
+
enumerable: true,
|
|
44
|
+
get: function get() {
|
|
45
|
+
return _utils.createMockTask;
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
Object.defineProperty(exports, "deferred", {
|
|
49
|
+
enumerable: true,
|
|
50
|
+
get: function get() {
|
|
51
|
+
return _utils.deferred;
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
Object.defineProperty(exports, "is", {
|
|
55
|
+
enumerable: true,
|
|
56
|
+
get: function get() {
|
|
57
|
+
return _utils.is;
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
Object.defineProperty(exports, "noop", {
|
|
61
|
+
enumerable: true,
|
|
62
|
+
get: function get() {
|
|
63
|
+
return _utils.noop;
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
exports.reducerKey = exports.pageKey = void 0;
|
|
67
|
+
var _utils = require("./internal/utils");
|
|
68
|
+
var _io = require("./internal/io");
|
|
69
|
+
var _proc = require("./internal/proc");
|
|
24
70
|
var pageKey = 'page';
|
|
25
71
|
exports.pageKey = pageKey;
|
|
26
72
|
var reducerKey = 'currentPage';
|
|
27
|
-
exports.reducerKey = reducerKey;
|
|
73
|
+
exports.reducerKey = reducerKey;
|
|
74
|
+
//# sourceMappingURL=utils.js.map
|
package/lib/utils.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","names":["_utils","require","_io","_proc","pageKey","exports","reducerKey"],"sources":["../utils.js"],"sourcesContent":["export {\n TASK,\n SAGA_ACTION,\n noop,\n is,\n deferred,\n arrayOfDeffered,\n createMockTask,\n cloneableGenerator,\n} from './internal/utils'\nexport { asEffect } from './internal/io'\nexport { CHANNEL_END } from './internal/proc'\n\nexport const pageKey = 'page';\nexport const reducerKey = 'currentPage';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAUA,IAAAC,GAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AAEO,IAAMG,OAAO,GAAG,MAAM;AAACC,OAAA,CAAAD,OAAA,GAAAA,OAAA;AACvB,IAAME,UAAU,GAAG,aAAa;AAACD,OAAA,CAAAC,UAAA,GAAAA,UAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vve/redux-saga",
|
|
3
|
-
"version": "9.0.0-alpha.
|
|
3
|
+
"version": "9.0.0-alpha.4",
|
|
4
4
|
"description": "Saga middleware for Redux to handle Side Effects",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -40,6 +40,9 @@
|
|
|
40
40
|
"url": "https://github.com/redux-saga/redux-saga/issues"
|
|
41
41
|
},
|
|
42
42
|
"homepage": "https://redux-saga.js.org/",
|
|
43
|
+
"dependencies": {
|
|
44
|
+
"@babel/runtime": "7.20.0"
|
|
45
|
+
},
|
|
43
46
|
"devDependencies": {
|
|
44
47
|
"@types/fs-extra": "^9.0.11",
|
|
45
48
|
"babel-plugin-annotate-pure-calls": "^0.4.0",
|
|
@@ -76,9 +79,7 @@
|
|
|
76
79
|
"test": "BABEL_ENV=cjs jest",
|
|
77
80
|
"check": "run-s lint test",
|
|
78
81
|
"clean": "rimraf dist es lib",
|
|
79
|
-
"build
|
|
80
|
-
"build:es": "BABEL_ENV=es babel src --out-dir es",
|
|
81
|
-
"build": "pnpm run clean && run-p build:**",
|
|
82
|
+
"build": "lecp",
|
|
82
83
|
"counter": "cross-env BABEL_ENV=cjs node examples/counter/server.js",
|
|
83
84
|
"cancellable-counter": "cross-env BABEL_ENV=cjs node examples/cancellable-counter/server.js",
|
|
84
85
|
"shop": "cross-env BABEL_ENV=cjs node examples/shopping-cart/server.js",
|