Created
July 2, 2017 04:19
-
-
Save afrontend/ef9dd428b15e4b4869845126b92ddef1 to your computer and use it in GitHub Desktop.
Async 모듈 사용전 도서 검색 코드
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
checkPointLimit = booklist.length; | |
appendBookId(booklist, body); | |
_.each(booklist, function(book, key) { | |
var o = _.clone(opt); | |
o.bookId = book.bookId; | |
var index = key; | |
searchDetail(o, function (err, exist) { | |
checkPoint = checkPoint + 1; | |
if (err) { | |
exist = false; | |
} | |
booklist[index].exist = exist; | |
if (checkPoint === checkPointLimit) { | |
if (getBook) { | |
getBook(null, { | |
startPage: opt.startPage, | |
totalBookCount: totalBookCount, | |
booklist: booklist | |
}); | |
} | |
} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment