File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change 1
- import { AttachSink } from './types'
2
1
import { ProxyStream } from './ProxyStream'
3
2
import { Stream } from '@most/types'
3
+ import { Subject } from './types'
4
4
import { id } from '@most/prelude'
5
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 ]
6
+ export function create < A = any > ( ) : Subject < A , A >
7
+ export function create < A , B > ( f : ( stream : Stream < A > ) => Stream < B > ) : Subject < A , B >
8
8
9
9
export function create < A , B = A > (
10
10
f : ( stream : Stream < A > ) => Stream < B > = id as ( stream : Stream < A > ) => Stream < B >
11
- ) : [ AttachSink < A > , Stream < B > ] {
11
+ ) : Subject < A , B > {
12
12
const source = new ProxyStream < A > ( )
13
13
14
14
return [ source , f ( source ) ]
Original file line number Diff line number Diff line change 1
1
import { Sink , Stream } from '@most/types'
2
2
3
+ export type Subject < A , B > = [ Sink < A > , Stream < B > ]
4
+
3
5
export interface AttachSink < A > extends Sink < A > {
4
6
attach ( source : Stream < A > ) : Stream < A >
5
7
}
You can’t perform that action at this time.
0 commit comments