I am using async waterfall like this
const profileRichness = () => {
async.waterfall([
getTargetUsers,
filterUser,
], (err) => {
if (err) errorlogger(uuid(), err, "email", "abc", "acc", "acd");
else console.log('Done');
});
}
Fn that I am calling
const getTargetUsers = (callback,condition) => {
user.getUsers(condition, (err, result) => {
if (err)
callback(err);
else {
if (result.length)
callback(null, result);
else
callback('No user found');
}
});
}
const filterUser = (users, callback) => {
users = users.filter(user => {
if (!user.age || user.profile < 80) return user;
else return false;
}).filter(user => user);
callback(null,users);
}
Problem is whatever I am trying to pass in first function of waterfall it returns error that “callback is not a function” what is exactly going on