first-val

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

npm install first-val
5 downloads in the last day
44 downloads in the last week
235 downloads in the last month

first-val

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

Install

$ npm install first-val

Usage

firstval = require('first-val')

search = firstval(searchRedis, searchMongo, searchPostgres)

search('hello world', function(result){

    result
    // => ['results from', 'the first value produced function']

})

function searchRedis(keyword, callback){}
function searchMongo(keyword, callback){}
function searchPostgres(keyword, callback){}

npm loves you