Enhanced angular $q on steroids.
Allows to create new promise chain
$q.fcall(function () {
// Do things
}).then(function () {
// More things
});Passes $http`s .success response down the chain.
$q.fcall(function() {
$http.get('http://cutekittens.com/meow');
}).success(function (data, status, headers, config) {
// Oh, the hard work here!
});Passes $http`s .error response down the chain.
$q.fcall(function() {
$http.get('http://cutekittens.com/meow');
}).error(function (data, status, headers, config) {
// Oh, error happened!
});Integrates timeout right into promise chain!
$q.fcall(function () {
// Whatever hard work here
}).delay(function () {
// Executed after 500ms
}, 500).then(function() {
// Executed normally
});Removes need to do separate return $q.all(Array) call.
$q.fcall(function () {
return [Promise, Promise, Promise];
}).all(function (resolved) {
// `resolved` contains resolved promises array
});Spreads array items as arguments.
$q.fcall(function () {
return ['a', 'b', 'c'];
}).all(function (a, b, c) {
// `a`, `b`, `c` contain their respective values
});