Skip to content

Commit

Permalink
fix: default sink return type to unknown (#46)
Browse files Browse the repository at this point in the history
Otherwise sync duplexes have to override the return type.
  • Loading branch information
achingbrain authored Apr 4, 2023
1 parent 02d1391 commit f4b7fc7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export interface Transform<A, B = A> {
* function that takes a source and iterates over it. It optionally returns
* a value.
*/
export interface Sink<Source, R = Promise<void>> {
export interface Sink<Source, R = unknown> {
(source: Source): R
}

Expand All @@ -32,7 +32,7 @@ export type Source<T> = AsyncIterable<T> | Iterable<T>
* necessarily connected to the values that can be consumed from it. It is
* an object with two properties, sink and source.
*/
export interface Duplex<TSource = unknown, TSink = TSource, RSink = Promise<void>> {
export interface Duplex<TSource = unknown, TSink = TSource, RSink = unknown> {
source: TSource
sink: Sink<TSink, RSink>
}

0 comments on commit f4b7fc7

Please sign in to comment.