File tree Expand file tree Collapse file tree 2 files changed +12
-12
lines changed Expand file tree Collapse file tree 2 files changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -19,18 +19,18 @@ export const test: Test = describe(`create`, [
19
19
return promise . then ( equal ( values ) )
20
20
} ) ,
21
21
22
- given ( `(Stream<A>) => B ` , [
23
- it ( `returns [Sink<A>, B ]` , ( { equal } ) => {
22
+ given ( `(Stream<A>) => Stream<B> ` , [
23
+ it ( `returns [Sink<A>, Stream<B> ]` , ( { equal } ) => {
24
24
const values = [ 1 , 2 , 3 ]
25
25
const scheduler = newDefaultScheduler ( )
26
- const [ sink , promise ] = create ( ( stream : Stream < number > ) =>
27
- collectEvents < number > ( scheduler , stream )
28
- )
26
+ const [ sink , stream ] = create ( )
29
27
30
- values . forEach ( n => sink . event ( currentTime ( scheduler ) , n ) )
31
- sink . end ( currentTime ( scheduler ) )
28
+ setTimeout ( function ( ) {
29
+ values . forEach ( n => sink . event ( currentTime ( scheduler ) , n ) )
30
+ sink . end ( currentTime ( scheduler ) )
31
+ } , 0 )
32
32
33
- return promise . then ( equal ( values ) )
33
+ return collectEvents ( scheduler , stream ) . then ( equal ( values ) )
34
34
} ) ,
35
35
] ) ,
36
36
Original file line number Diff line number Diff line change @@ -6,10 +6,10 @@ import { id } from '@most/prelude'
6
6
export function create < A = any > ( ) : [ AttachSink < A > , Stream < A > ]
7
7
export function create < A , B > ( f : ( stream : Stream < A > ) => B ) : [ AttachSink < A > , B ]
8
8
9
- export function create < A , B = Stream < A > > (
10
- f : ( stream : Stream < A > ) => B = id as ( stream : Stream < A > ) => B
11
- ) : [ AttachSink < A > , B ] {
12
- const source = new ProxyStream ( )
9
+ export function create < A , B = A > (
10
+ f : ( stream : Stream < A > ) => Stream < B > = id as ( stream : Stream < A > ) => Stream < B >
11
+ ) : [ AttachSink < A > , Stream < B > ] {
12
+ const source = new ProxyStream < A > ( )
13
13
14
14
return [ source , f ( source ) ]
15
15
}
You can’t perform that action at this time.
0 commit comments