immutable-list-reduce-async
Small extention to the immutable list to perform an async reducer
This can be useful if a reducer function has to perform an asynchronous operation. So, instead of a result it returns
an instance of a Task (from data.task
package):
// myReducer :: b -> a -> Task bconst myReducer = { // Some async action here. } // reduceAsync :: (b -> a -> Task b) -> b -> Task bListprototypereduceAsync
Example:
const Task = const List = // Reduce to the sum of list elements with an async action (Task):var app = app // >>> 6