https://kotlinlang.org logo
#coroutines
Title
# coroutines
a

ashdavies

06/16/2018, 11:19 PM
Will there be a
filterIsInstance
method available for
ReceiveChannel
? If not, should I propose one as a PR? on KEEP or on the main repo?
v

Vsevolod Tolstopyatov [JB]

06/17/2018, 11:25 AM
There isn’t any because it’s easy to implement using existing
filter
method. We’d like to avoid having dozens of Rx-like operators, especially with channels, which differ from Rx/reactor/akka cold streams
a

ashdavies

06/17/2018, 12:07 PM
Well, my thoughts were that might not be the case because
filterIsInstance
is already on
CollectionsKt
, though rx offers
ofType<T>
, it might be a pretty common operator
But you’re right its pretty easy to achieve with filter/map, it just seems unnecessary
4 Views