boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Programming版 - js myFunc = (routePath, myRedirect) => (newUrl, middleware) => {...}
相关主题
question about const reference
[合集] static const代替define的performance tradeoff在哪里?
const_cast问题
function declaration
吓一跳JAVA真的这么挫了么
大牛们讲讲MQ到底好在哪里?
node.js不可放弃
angular搞cross domain必须用node吗?
讨论node/angular route的error handling
Confused by Javascript middleware styles
相关话题的讨论汇总
话题: newurl话题: routepath话题: myredirect话题: middleware话题: myfunc
进入Programming版参与讨论
1 (共1页)
s*****w
发帖数: 1527
1
有没有这样的写法?
pseudo code这么写,请大家看看应该怎么改正。
const myRedirect = (routePath) => {
newUrl = routePath;
if (matches condition)
newUrl = do_some_modification(routePath);
return next(newUrl);
}
const myFunc = (routePath, myRedirect) => (newUrl, middleware) => {
return (ctx, newUrl, next) => {
return middleware(ctx, newUrl, next);
}
};
1 (共1页)
进入Programming版参与讨论
相关主题
Confused by Javascript middleware styles
用pseudo-code 写数据结构问题。
请教register
谁能推荐一个read-writer lock的C++实现? (转载)
大家觉得这样的code怎么样?
[合集] Java coding convention 里面
[合集] 如何选择代码,版本管理器?CVS 还是 SVN 还是其它?
Random number generator in C++
请教个排序的题目
firefox浏览器插件开发,要求实现过滤掉敏感词
相关话题的讨论汇总
话题: newurl话题: routepath话题: myredirect话题: middleware话题: myfunc