Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

127
Views
how to pass argument in async waterfall inital function

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

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!