How to use the resolve function from when

Find comprehensive JavaScript when.resolve code examples handpicked from public code repositorys.

138
139
140
141
142
143
144
145
146
147
        ee.emit('close',0);
    },10)
    return ee;
});
var addModule = sinon.stub(registry,"addModule",function(md) {
    return when.resolve(nodeInfo);
});

installer.installModule("this_wont_exist").then(function(info) {
    info.should.eql(nodeInfo);
fork icon14
star icon73
watch icon0

+ 2 other calls in file

106
107
108
109
110
111
112
113
114
115
},
getSettings: function() {
    if (settingsAvailable) {
        return storageModule.getSettings();
    } else {
        return when.resolve(null);
    }
},
saveSettings: function(settings) {
    if (settingsAvailable) {
fork icon14
star icon73
watch icon0

+ 4 other calls in file

312
313
314
315
316
317
318
319
320
321
} else {
    var key = appname+"/lib/"+type+path;
}

if (libraryCache[key]) {
    return when.resolve(libraryCache[key]);
}

return when.promise(function(resolve,reject) {
    flowDb.get(key,function(err,doc) {
fork icon2
star icon0
watch icon0

24
25
26
27
28
29
30
31
32
33
34
35
        });
};


Importer000.prototype.canImport = function (data) {
    if (data.meta && data.meta.version && this.importFrom[data.meta.version]) {
        return when.resolve(this.importFrom[data.meta.version]);
    }


    return when.reject("Unsupported version of data: " + data.meta.version);
};
fork icon0
star icon0
watch icon0

+ 2 other calls in file