We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e8fb376 commit d175d90Copy full SHA for d175d90
src/create.ts
@@ -1,14 +1,15 @@
1
import { AttachSink } from './types'
2
import { ProxyStream } from './ProxyStream'
3
import { Stream } from '@most/types'
4
+import { id } from '@most/prelude'
5
6
export function create<A = any>(): [AttachSink<A>, Stream<A>]
7
export function create<A, B>(f: (stream: Stream<A>) => B): [AttachSink<A>, B]
8
9
export function create<A, B = Stream<A>>(
- f?: (stream: Stream<A>) => B
10
+ f: (stream: Stream<A>) => B = id as (stream: Stream<A>) => B
11
): [AttachSink<A>, B] {
12
const source = new ProxyStream()
13
- return [source, f === void 0 ? (source as any) as B : f(source)]
14
+ return [source, f(source)]
15
}
0 commit comments