Hey Staltz, I was wondering if you'd be open to exporting two interface subtypes of Stream<A>, one that contains all of the methods that are contravariant in A maybe called Sink<A> and one that contains all of the methods that are covariant in A maybe called Source<A>. This would allow for proper subtyping of methods that are expecting source / sink streams as Stream<A> is currently invariant in A.
For example
export type ContravariantMethods = 'addListener' | 'removeListener' | 'subscribe'
export interface Sink<A> extends Pick<Stream<A>, ContravariantMethods> {}
Most of the covariant methods on Stream<A> are static, with the exception of remember and debug. So the Source type makes less sense.
Hey Staltz, I was wondering if you'd be open to exporting two interface subtypes of
Stream<A>, one that contains all of the methods that are contravariant inAmaybe calledSink<A>and one that contains all of the methods that are covariant inAmaybe calledSource<A>. This would allow for proper subtyping of methods that are expecting source / sink streams asStream<A>is currently invariant inA.For example
Most of the covariant methods on
Stream<A>are static, with the exception ofrememberanddebug. So the Source type makes less sense.