私は配列を持っています。いくつかの編集を使用して再コンパイルする必要があります。の助けを借りてそれを行いますがasync.concat()
、何かが機能していません。教えて、どこが間違っているの?
async.concat(dialogs, function(dialog, callback) {
if (dialog['viewer']['user_profile_image'] != null) {
fs.exists(IM.pathToUserImage + dialog['viewer']['user_profile_image'].replace('%s', ''), function(exits) {
if (exits) {
dialog['viewer']['user_profile_image'] = dialog['viewer']['user_profile_image'].replace('%s', '');
}
callback(dialog);
});
}
}, function() {
console.log(arguments);
});
私の意見では、すべてが論理的です。コールバックは、最初の反復の直後に呼び出されます。しかし、配列全体の処理が完了した後、どうすればデータを送信できますか?
ありがとうございました!