如何在 Parse.com CloudCode 上创建自定义帮助程序模块以与 then() promise 一起使用?类
how to create a custom helper module on Parse.com CloudCode for using with then() promise? TypeError: Cannot call method 'then' of undefined
我是 Parse.com CloudCode和Node的新手.js
我正在尝试找到一种方法来创建帮助程序模块,其中包含一些查询和其他常见代码,我可能需要在我的应用程序中一遍又一遍地使用。
如何使用不同步的帮助程序方法创建模块?
我怎样才能让它与承诺一起工作? http://blog.parse.com/2013/01/29/whats-so-great-about-javascript-promises/
这是我的意图。我不确定正确的方法是什么
我收到此错误:类型错误:无法调用未定义的方法"then"
exports.getMyObjects = function (myParam, status) {
var MyObject = Parse.Object.extend("MyObject");
var query = new Parse.Query(MyObject);
query.get(myParam).then(function(myObjects){
status.success(myObjects);
},function(error){
status.error(error);
});
};
//Here on another file I'm trying to use the module
var helper = require('cloud/helper.js');
helper.getMyObjects('sdfsd43').then(function(myObjects){
//Objects found!
},function(error){
//Error
});
// I'm getting thes error from parse: TypeError: Cannot call method 'then' of undefined
我遇到了类似的问题,并且能够通过更改global.json中的解析版本来修复它
"全局":{
"parseVersion": "1.2.7"
}
相关文章:
- Promise函数在.then之后未运行函数化
- 如何在异步函数中正确使用Promise.all()和then()
- 在javascript promise中正确使用then
- 将数据从promise then方法传递到对象方法
- JavaScript Promise then() ordering
- Node.js Promise - 代码不应该等到 .then 完成()
- 运行Promise.all()中的When-is-then-then子句
- 使用promise.then时,是否可以保留在单击事件调用堆栈中
- 如何重写这段代码,使执行不必从Javascript Promise.then()方法开始
- Node.js中的Promise.all没有't调用then函数
- 如何在 Parse.com CloudCode 上创建自定义帮助程序模块以与 then() promise 一起使用?类
- ngResource.myfunc().$promise.then 返回空数组
- 量角器:我是否过度使用了promise.then()
- Promise/A+ with chain then() 回调用例
- 为什么来自 Promise '.then' 方法的回调是反模式
- 返回值和 Promise.resolve 从 then() 有什么区别
- Promise.resolve().then vs setImmediate vs nextTick
- 为什么 JavaScript Promise 有时既不使用 .catch 也不使用 .then
- 如果 then 处理程序不返回任何内容,则链式 Promise 的解析值是多少
- .then(Promise.mapSeries(..))的行为是否与.then(function(){return Pr