Skip to content

Commit

Permalink
promisefy
Browse files Browse the repository at this point in the history
  • Loading branch information
starkwang committed Mar 14, 2016
1 parent b124287 commit 42b9331
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ var Promise = require('bluebird');

var getAllFollowees = {
counter: 0,
store:[],
store: [],
request: function(options) {
if (!options) {
var options = {};
Expand Down Expand Up @@ -31,22 +31,22 @@ var getAllFollowees = {
console.log(_this.counter + ' complete');
if (tmp.length > 0) {
_this.counter = _this.counter + 20;
_this.request(options);
resolve(_this.request(options));
} else {
_this.complete();
resolve({
data: _this.store
});
};
})
})
},
complete:function(){
console.log("========RESULT========");
console.log(this.store);
console.log("========RESULT========");
}
}

getAllFollowees.request({
followees: true
}).then(function(result) {
console.log("success!!!");
console.log(result);
})

function parseCard(text) {
Expand Down

0 comments on commit 42b9331

Please sign in to comment.