folktale / data.task

Migrating to https://github.com/origamitower/folktale
MIT License
425 stars 45 forks source link

[QUESTION] List of Tasks running one after another #45

Closed robertcasanova closed 5 years ago

robertcasanova commented 5 years ago

Sorry to disturb you here, but i can't figure out how to solve this simple problem. Basically i have a list of tasks List.of(task1,task2,task3) and i want to chain one task to another so it should become task1().chain(task2).chain(task3).

Is there a simple way to handle this?

Thx for help.

robotlolita commented 5 years ago

Control.Monads' sequence (https://github.com/folktale/control.monads/blob/master/lib/basic.js#L50-L59) can be used for that.

sequence(Task, [task1, task2, task3]);
robertcasanova commented 5 years ago

Ohh thx a lot, you make my day!!! :-) 👍