"use strict";var exports=module.exports={};
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.TASK_CANCEL = exports.CHANNEL_END = exports.NOT_ITERATOR_ERROR = undefined;
var _keys = require('../../../babel-runtime/core-js/object/keys.js');
var _keys2 = _interopRequireDefault(_keys);
var _from = require('../../../babel-runtime/core-js/array/from.js');
var _from2 = _interopRequireDefault(_from);
var _defineProperty2 = require('../../../babel-runtime/core-js/object/define-property.js');
var _defineProperty3 = _interopRequireDefault(_defineProperty2);
exports.default = proc;
var _utils = require('./utils.js');
var _scheduler = require('./scheduler.js');
var _io = require('./io.js');
var _channel = require('./channel.js');
var _buffers = require('./buffers.js');
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _defineEnumerableProperties(obj, descs) {
for (var key in descs) {
var desc = descs[key];desc.configurable = desc.enumerable = true;if ("value" in desc) desc.writable = true;(0, _defineProperty3.default)(obj, key, desc);
}return obj;
}
function _toConsumableArray(arr) {
if (Array.isArray(arr)) {
for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) {
arr2[i] = arr[i];
}return arr2;
} else {
return (0, _from2.default)(arr);
}
}
function _defineProperty(obj, key, value) {
if (key in obj) {
(0, _defineProperty3.default)(obj, key, { value: value, enumerable: true, configurable: true, writable: true });
} else {
obj[key] = value;
}return obj;
}
var isDev = "development" === 'development';
var NOT_ITERATOR_ERROR = exports.NOT_ITERATOR_ERROR = 'proc first argument (Saga function result) must be an iterator';
var CHANNEL_END = exports.CHANNEL_END = {
toString: function toString() {
return '@@redux-saga/CHANNEL_END';
}
};
var TASK_CANCEL = exports.TASK_CANCEL = {
toString: function toString() {
return '@@redux-saga/TASK_CANCEL';
}
};
var matchers = {
wildcard: function wildcard() {
return _utils.kTrue;
},
default: function _default(pattern) {
return function (input) {
return input.type === pattern;
};
},
array: function array(patterns) {
return function (input) {
return patterns.some(function (p) {
return p === input.type;
});
};
},
predicate: function predicate(_predicate) {
return function (input) {
return _predicate(input);
};
}
};
function matcher(pattern) {
return (pattern === '*' ? matchers.wildcard : _utils.is.array(pattern) ? matchers.array : _utils.is.func(pattern) ? matchers.predicate : matchers.default)(pattern);
}
/**
Used to track a parent task and its forks
In the new fork model, forked tasks are attached by default to their parent
We model this using the concept of Parent task && main Task
main task is the main flow of the current Generator, the parent tasks is the
aggregation of the main tasks + all its forked tasks.
Thus the whole model represents an execution tree with multiple branches (vs the
linear execution tree in sequential (non parallel) programming)
A parent tasks has the following semantics
- It completes iff all its forks either complete or all cancelled
- If it's cancelled, all forks are cancelled as well
- It aborts if any uncaught error bubbles up from forks
- If it completes, the return value is the one returned by the main task
**/
function forkQueue(name, mainTask, cb) {
var tasks = [],
result = void 0,
completed = false;
addTask(mainTask);
function abort(err) {
cancelAll();
cb(err, true);
}
function addTask(task) {
tasks.push(task);
task.cont = function (res, isErr) {
if (completed) {
return;
}
(0, _utils.remove)(tasks, task);
task.cont = _utils.noop;
if (isErr) {
abort(res);
} else {
if (task === mainTask) {
result = res;
}
if (!tasks.length) {
completed = true;
cb(result);
}
}
};
// task.cont.cancel = task.cancel
}
function cancelAll() {
if (completed) {
return;
}
completed = true;
tasks.forEach(function (t) {
t.cont = _utils.noop;
t.cancel();
});
tasks = [];
}
return {
addTask: addTask,
cancelAll: cancelAll,
abort: abort,
getTasks: function getTasks() {
return tasks;
},
taskNames: function taskNames() {
return tasks.map(function (t) {
return t.name;
});
}
};
}
function createTaskIterator(_ref) {
var context = _ref.context,
fn = _ref.fn,
args = _ref.args;
if (_utils.is.iterator(fn)) {
return fn;
}
// catch synchronous failures; see #152 and #441
var result = void 0,
error = void 0;
try {
result = fn.apply(context, args);
} catch (err) {
error = err;
}
// i.e. a generator function returns an iterator
if (_utils.is.iterator(result)) {
return result;
}
// do not bubble up synchronous failures for detached forks
// instead create a failed task. See #152 and #441
return error ? (0, _utils.makeIterator)(function () {
throw error;
}) : (0, _utils.makeIterator)(function () {
var pc = void 0;
var eff = { done: false, value: result };
var ret = function ret(value) {
return { done: true, value: value };
};
return function (arg) {
if (!pc) {
pc = true;
return eff;
} else {
return ret(arg);
}
};
}());
}
function wrapHelper(helper) {
return {
fn: helper
};
}
function proc(iterator) {
var subscribe = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function () {
return _utils.noop;
};
var dispatch = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _utils.noop;
var getState = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : _utils.noop;
var options = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {};
var parentEffectId = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0;
var name = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : 'anonymous';
var cont = arguments[7];
(0, _utils.check)(iterator, _utils.is.iterator, NOT_ITERATOR_ERROR);
var sagaMonitor = options.sagaMonitor,
logger = options.logger,
onError = options.onError;
var log = logger || _utils.log;
var stdChannel = (0, _channel.stdChannel)(subscribe);
/**
Tracks the current effect cancellation
Each time the generator progresses. calling runEffect will set a new value
on it. It allows propagating cancellation to child effects
**/
next.cancel = _utils.noop;
/**
Creates a new task descriptor for this generator, We'll also create a main task
to track the main flow (besides other forked tasks)
**/
var task = newTask(parentEffectId, name, iterator, cont);
var mainTask = { name: name, cancel: cancelMain, isRunning: true };
var taskQueue = forkQueue(name, mainTask, end);
/**
cancellation of the main task. We'll simply resume the Generator with a Cancel
**/
function cancelMain() {
if (mainTask.isRunning && !mainTask.isCancelled) {
mainTask.isCancelled = true;
next(TASK_CANCEL);
}
}
/**
This may be called by a parent generator to trigger/propagate cancellation
cancel all pending tasks (including the main task), then end the current task.
Cancellation propagates down to the whole execution tree holded by this Parent task
It's also propagated to all joiners of this task and their execution tree/joiners
Cancellation is noop for terminated/Cancelled tasks tasks
**/
function cancel() {
/**
We need to check both Running and Cancelled status
Tasks can be Cancelled but still Running
**/
if (
没有合适的资源?快使用搜索试试~ 我知道了~
微信小程序源码 医药网(源码+截图).rar
共556个文件
js:471个
png:37个
wxss:8个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 99 浏览量
2023-04-10
09:20:58
上传
评论
收藏 3.96MB RAR 举报
温馨提示
免责声明:资料部分来源于合法的互联网渠道收集和整理,部分自己学习积累成果,供大家学习参考与交流。收取的费用仅用于收集和整理资料耗费时间的酬劳。 本人尊重原创作者或出版方,资料版权归原作者或出版方所有,本人不对所涉及的版权问题或内容负法律责任。如有侵权,请举报或通知本人删除。
资源推荐
资源详情
资源评论
收起资源包目录
微信小程序源码 医药网(源码+截图).rar (556个子文件)
.babelrc 470B
.editorconfig 148B
.eslintignore 31B
.eslintrc 1KB
.flowconfig 152B
壹药网1.gif 2.19MB
1.gif 860KB
.gitignore 605B
proc.js 82KB
seamless-immutable.js 77KB
index.js 45KB
component.js 44KB
io.js 32KB
utils.js 26KB
createStore.js 25KB
runtime.js 22KB
sagaHelpers.js 21KB
stringify.js 20KB
combineReducers.js 19KB
createPersistor.js 19KB
utils.js 19KB
createActions.js 19KB
core.js 19KB
channel.js 18KB
create-page.js 16KB
asyncLocalStorage.js 15KB
request.js 14KB
autoRehydrate.js 14KB
index.js 14KB
getStoredState.js 13KB
index.js 13KB
middleware.js 13KB
handleAction.js 12KB
index.js 12KB
prop-types.js 11KB
es6.promise.js 10KB
connect.js 10KB
index.js 10KB
index.js 10KB
persistStore.js 9KB
buffers.js 9KB
es6.symbol.js 9KB
cart.js 9KB
cart.js 9KB
category.js 8KB
createAction.js 8KB
diff.js 8KB
utils.js 7KB
home.js 7KB
combineActions.js 7KB
applyMiddleware.js 7KB
bindActionCreators.js 7KB
purgeStoredState.js 6KB
createStore.js 5KB
_baseClone.js 5KB
handleActions.js 5KB
browser.js 5KB
app.js 5KB
banner.js 5KB
index.js 5KB
index.js 4KB
stringify.js 4KB
request.js 4KB
shoppingitem.js 4KB
index.js 4KB
defaults.js 4KB
scheduler.js 4KB
component.js 4KB
index.js 4KB
mine.js 4KB
_equalByTag.js 4KB
runSaga.js 4KB
compose.js 4KB
isStatePlainEnough.js 3KB
_deburrLetter.js 3KB
helpers.js 3KB
createTransform.js 3KB
is_arguments.js 3KB
_baseIsEqualDeep.js 3KB
specialitem.js 3KB
_unicodeWords.js 3KB
navibtns.js 3KB
_equalObjects.js 3KB
_iter-define.js 3KB
effects.js 3KB
cart.js 3KB
_equalArrays.js 3KB
ownKeys.js 3KB
_initCloneByTag.js 2KB
_export.js 2KB
_task.js 2KB
global.js 2KB
warning.js 2KB
_baseIsTypedArray.js 2KB
memoize.js 2KB
index.js 2KB
index.js 2KB
index.js 2KB
index.js 2KB
isEmpty.js 2KB
共 556 条
- 1
- 2
- 3
- 4
- 5
- 6
资源评论
荣华富贵8
- 粉丝: 213
- 资源: 7653
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- androidx.multidex.MultiDexApplication.apk.1
- 丑子金装美化32(1).zip
- 基于Visual Basic .Net及Python技术的学校需求解决方案设计源码
- 基于Java语言的Web开发学习Demo设计源码
- 基于Java的医院排队叫号系统界面原型设计源码
- 基于Java语言的Himalaya仿喜马拉雅设计源码
- 基于PHP+HTML+CSS+JavaScript的智能电车管家设计源码
- 基于Emscripten编译的纯H5直播流播放器jessibuca设计源码
- 基于react-native的Android隐私合规配置与代码集成设计源码
- 基于JavaFX技术的全功能色彩管理器设计源码
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功