Make transformToHandlers public
Hello folks,
Currently transformFromHandlers isn't exported in lib/stream_transform.dart. Is it possible to expose it?
It's better than the standard fromHandlers transformer in the sense that it allows relying on a common state for broadcast streams since callbacks are called once per event only.
cc @lrhn for thoughts.
The utility is:
https://github.com/dart-lang/stream_transform/blob/053711699fe0163c8106ea544729f5058e610ff3/lib/src/from_handlers.dart#L7-L16
I can see value in exposing this. If we decide we do want to expose it we should consider the naming (I wasn't careful about that as an internal detail), as well as wether an extension method is the right API (I think it is).
It seems useful, so sure, why not.
Naming is hard.... let's go shopping. All the good names are taken! 😁
It should be named something with transform. Maybe just transformEvents. It doesn't transform the stream into a separate stream, but the events into different events (which is potatoe/potatoh really, but might make sense to the user anyway).
It also matches, to me, with that each event is only transformed once,