Open kelvinst opened 7 years ago
It would be awesome to have an easy way to plug this in a Enum/Stream/Flow pipeline. Since nowadays we have to do something like:
count = length(list) list |> Stream.with_index(1) |> Stream.map(fn({item, idx}) -> ProgressBar.render(idx, count) item end) |> process_list
What I suggest is something like:
list |> ProgressBar.from_enumerable(progress_bar_opts) |> process_list
Together with progress_bar_opts, I guess it would be a good thing if we ask the count, since then the length can be calculated only once and for all.
progress_bar_opts
count
I would be glad to open a PR, but maybe I will not be able to do it soon.
Great idea!
It would be awesome to have an easy way to plug this in a Enum/Stream/Flow pipeline. Since nowadays we have to do something like:
What I suggest is something like:
Together with
progress_bar_opts
, I guess it would be a good thing if we ask thecount
, since then the length can be calculated only once and for all.I would be glad to open a PR, but maybe I will not be able to do it soon.