Skip to content

archived-repos/promise

Folders and files

NameName
Last commit message
Last commit date

Latest commit

c0f3b16 · Jun 5, 2015

History

53 Commits
Jun 5, 2015
Dec 6, 2014
Dec 8, 2014
Feb 11, 2015
Dec 6, 2014
May 16, 2015
Jun 5, 2015
Jun 5, 2015
Jun 5, 2015
Jun 5, 2015
Jun 5, 2015
May 2, 2015

Repository files navigation

jEngine: $promise wercker status

Bower version npm version Build Status Installation

npm install jengine-promise --save

or

bower install jengine-promise --save

Usage

$promise(function (resolve, reject) {
        resolve('gogogo!');
    })

    .finally(function (result) {
        console.log('checkpoint 4', result);
    }, function (reason) {
        console.log('checkpoint 4.1', reason);
    })

    .then(function (result) {
        console.log('checkpoint 1', result);
        throw 'whoops!';
    })

    .then(function (result) {
        console.log('checkpoint 2', result);
    },function (result) {
        console.log('checkpoint 2.1', result);
        return qPromise(function (resolve, reject) {
            setTimeout(function () { resolve('all right!'); }, 400);
        });
    })

    .then(function (result) {
        console.log('checkpoint 3', result);
    }, function (reason) {
        console.log('checkpoint 3.1', reason);
    })
;

output:

checkpoint 1 gogogo!
checkpoint 2.1 whoops!
# elapsed 400ms
checkpoint 3 all right!
checkpoint 4 all right!

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published