first-val

Execute given async functions in given order until a value is produced

Execute given async functions in given order until a value is produced

$ npm install first-val
firstval = require('first-val')
 
search = firstval(searchRedis, searchMongo, searchPostgres)
 
search('hello world', function(result){
 
    result
    // => ['results from', 'the first value produced function'] 
 
})
 
function searchRedis(keywordcallback){}
function searchMongo(keywordcallback){}
function searchPostgres(keywordcallback){}