@@ -4,18 +4,18 @@ export const bufferToggle: OperatorDoc = {
4
4
name : 'bufferToggle' ,
5
5
operatorType : 'transformation' ,
6
6
signature : `bufferToggle(
7
- openings: SubscribableOrPromise<O> ,
8
- closingSelector: (value: O ) => SubscribableOrPromise): Observable<T[]> ` ,
7
+ openings: SubscribableOrPromise,
8
+ closingSelector: (value) => SubscribableOrPromise): Observable` ,
9
9
parameters : [
10
10
{
11
11
name : 'openings' ,
12
- type : 'SubscribableOrPromise<O> ' ,
12
+ type : 'SubscribableOrPromise' ,
13
13
attribute : '' ,
14
14
description : `A Subscribable or Promise of notifications to start new buffers.`
15
15
} ,
16
16
{
17
17
name : 'closingSelector' ,
18
- type : '(value: O ) => SubscribableOrPromise' ,
18
+ type : '(value) => SubscribableOrPromise' ,
19
19
attribute : '' ,
20
20
description : `A function that takes the value emitted by the openings observable
21
21
and returns a Subscribable or Promise, which, when it emits, signals that the associated buffer should be emitted and cleared.`
@@ -53,6 +53,7 @@ export const bufferToggle: OperatorDoc = {
53
53
const buffered = clicks.pipe(
54
54
bufferToggle(openings, i => i % 2 ? interval(500) : empty())
55
55
);
56
+ buffered.subscribe(x => console.log(x));
56
57
/*
57
58
Expected console output:
58
59
@@ -73,11 +74,10 @@ export const bufferToggle: OperatorDoc = {
73
74
74
75
[]
75
76
*/
76
- buffered.subscribe(x => console.log(x));
77
77
` ,
78
78
externalLink : {
79
79
platform : 'JSBin' ,
80
- url : 'http://jsbin.com/nuriyod/3 /embed?js,console,output'
80
+ url : 'http://jsbin.com/nuriyod/6 /embed?js,console,output'
81
81
}
82
82
} ,
83
83
{
@@ -94,6 +94,8 @@ export const bufferToggle: OperatorDoc = {
94
94
const buffered = clicks.pipe(
95
95
bufferToggle(openings, _ => closing)
96
96
);
97
+ buffered.subscribe(x => console.log(x));
98
+
97
99
/*
98
100
Expected console output:
99
101
@@ -126,14 +128,11 @@ export const bufferToggle: OperatorDoc = {
126
128
x: 143,
127
129
y: 136
128
130
}]
129
-
130
131
*/
131
-
132
- buffered.subscribe(x => console.log(x));
133
132
` ,
134
133
externalLink : {
135
134
platform : 'JSBin' ,
136
- url : 'http://jsbin.com/vurobel/11 /embed?js,console,output'
135
+ url : 'http://jsbin.com/vurobel/12 /embed?js,console,output'
137
136
}
138
137
}
139
138
] ,
0 commit comments