elm/core

Request: Parellelize 2 Or more Tasks And Emit One Single Msg

supermacro opened this issue · 2 comments

This is a feature request.

See here for context: https://old.reddit.com/r/elm/comments/91t937/is_it_possible_to_make_multiple_http_requests_in/

Imagine I have 2 http requests:

  • getDogs : Cmd DogList
  • getCats : Cmd CatList

I would like to run these two in parallel and emit one single message, GotAnimals (DogList, CatList).

Having to handle each msg individually in the update function leads to avoidable complexity.


Edit: There's even a package for this (https://package.elm-lang.org/packages/0ui/elm-task-parallel/latest/), but I think it's a common enough need that it should be baked into the language.

Thanks for reporting this! To set expectations:

  • Issues are reviewed in batches, so it can take some time to get a response.
  • Ask questions a community forum. You will get an answer quicker that way!
  • If you experience something similar, open a new issue. We like duplicates.

Finally, please be patient with the core team. They are trying their best with limited resources.

Thanks for reporting this! To set expectations:

  • Issues are reviewed in batches, so it can take some time to get a response.
  • Ask questions a community forum. You will get an answer quicker that way!
  • If you experience something similar, open a new issue. We like duplicates.

Finally, please be patient with the core team. They are trying their best with limited resources.