We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pomelo.request = function(route) { console.log('i am in request'); if(!route) { return; } var msg = {}; var cb; arguments = Array.prototype.slice.apply(arguments); if(arguments.length === 2){ console.log('i am in request arg = 2'); if(typeof arguments[1] === 'function'){ cb = arguments[1]; } else if(typeof arguments[1] === 'object'){ msg = arguments[1]; } } else if(arguments.length === 3){ msg = arguments[1]; cb = arguments[2]; }
id++; callbacks[id] = cb; sendMessage(id, route, msg);
};
为何这里只有一个参数,搞不懂什么情况,而且websocket中此处也是3个参数,难道有什么他俩又什么不同吗
The text was updated successfully, but these errors were encountered:
为什么没有回应呢 这里提供的接口pomelo.request(route, params, callback); 也是有3个参数的
Sorry, something went wrong.
汗, 来 nodejs.netease.com 吧, 这边issue容易漏掉
On Thu, Aug 1, 2013 at 3:22 PM, wulin9005 [email protected] wrote:
为什么没有回应呢 这里提供的接口pomelo.request(route, params, callback); 也是有3个参数的 — Reply to this email directly or view it on GitHubhttps://github.com//issues/1#issuecomment-21919322 .
— Reply to this email directly or view it on GitHubhttps://github.com//issues/1#issuecomment-21919322 .
javascript是动态参数的,因为后面params可能不传, 所以函数定义里没写。
No branches or pull requests
pomelo.request = function(route) {
console.log('i am in request');
if(!route) {
return;
}
var msg = {};
var cb;
arguments = Array.prototype.slice.apply(arguments);
if(arguments.length === 2){
console.log('i am in request arg = 2');
if(typeof arguments[1] === 'function'){
cb = arguments[1];
} else if(typeof arguments[1] === 'object'){
msg = arguments[1];
}
} else if(arguments.length === 3){
msg = arguments[1];
cb = arguments[2];
}
};
为何这里只有一个参数,搞不懂什么情况,而且websocket中此处也是3个参数,难道有什么他俩又什么不同吗
The text was updated successfully, but these errors were encountered: