A async promised function which returns the fastest action of a list:
import { factoryActions } from 'ava-ia/lib/helpers'; import { forecastYahoo, forecastMSN } from 'ava-ia/lib/actions'; return factoryActions(state, actions);
'use strict'; export default async (state, actions) => { const promises = actions.map( (action) => action.call(null, state) ); return await Promise.race(promises); }
There was an error while loading. Please reload this page.
Feel free to offer new features, improvements or anything you can think of. This project makes sense with your participation and experience using Ava.