dart-lang / stream_transform

Dart utility methods to create StreamTransfomer instances to manipulate Streams

Home Page:https://pub.dev/packages/stream_transform

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add prepend - the reverse of concat

natebosch opened this issue · comments

In some places it might be useful to reverse the order of concatenation to reduce nesting.

values
    .transform(step1)
    .transform(step2)
    .transform(step3)
    .transform(prepend(startingValues));

vs

startingValues.transform(concat(values
    .transform(step1)
    .transform(step2)
    .transform(step3)));

The particular place I'm hitting this would be better solved with #19 so I'm less sure of the value here. It's also a little confusing to have prepend and startWith mean totally different things.