Skip to content
This repository was archived by the owner on Apr 20, 2018. It is now read-only.

Commit 9dba472

Browse files
Merge pull request #507 from 38elements/master
Update document
2 parents af71b79 + 25c9130 commit 9dba472

5 files changed

Lines changed: 11 additions & 11 deletions

File tree

doc/api/core/operators/buffer.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ File:
134134
Dist:
135135
- [`rx.all.js`](https://github.com/Reactive-Extensions/RxJS/blob/master/dist/rx.all.js)
136136
- [`rx.all.compat.js`](https://github.com/Reactive-Extensions/RxJS/blob/master/dist/rx.all.js)
137-
- [rx.coincidence.js](https://github.com/Reactive-Extensions/RxJS/blob/master/dist/rx.coincidence.js)
137+
- [`rx.coincidence.js`](https://github.com/Reactive-Extensions/RxJS/blob/master/dist/rx.coincidence.js)
138138

139139
Prerequisites:
140140
- [`rx.js`](https://github.com/Reactive-Extensions/RxJS/blob/master/dist/rx.js) | [`rx.compat.js`](https://github.com/Reactive-Extensions/RxJS/blob/master/dist/rx.compat.js) | [`rx.lite.js`](https://github.com/Reactive-Extensions/RxJS/blob/master/dist/rx.lite.js) | [`rx.lite.compat.js`](https://github.com/Reactive-Extensions/RxJS/blob/master/dist/rx.lite.compat.js)

doc/api/subjects/replaysubject.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ subject.onNext('d');
9898
## _ReplaySubject Instance Methods_ ##
9999

100100
### <a id="rxreplaysubjectprototypedispose"></a>`Rx.ReplaySubject.prototype.dispose()`
101-
<a href="#rxreplaysubjectprototypedispose">#</a> [&#x24C8;](https://github.com/Reactive-Extensions/RxJS/blob/master/src/core/subjects/ReplaySubject.js#L147-L150 "View in source")
101+
<a href="#rxreplaysubjectprototypedispose">#</a> [&#x24C8;](https://github.com/Reactive-Extensions/RxJS/blob/master/src/core/subjects/replaysubject.js#L130-L133 "View in source")
102102

103103
Unsubscribe all observers and release resources.
104104

@@ -141,7 +141,7 @@ try {
141141
* * *
142142

143143
### <a id="rxreplaysubjectprototypehasobservers"></a>`Rx.ReplaySubject.prototype.hasObservers()`
144-
<a href="#rxreplaysubjectprototypehasobservers">#</a> [&#x24C8;](https://github.com/Reactive-Extensions/RxJS/blob/master/src/core/subjects/ReplaySubject.js#L71-L73 "View in source")
144+
<a href="#rxreplaysubjectprototypehasobservers">#</a> [&#x24C8;](https://github.com/Reactive-Extensions/RxJS/blob/master/src/core/subjects/replaysubject.js#L61-L63 "View in source")
145145

146146
Indicates whether the subject has observers subscribed to it.
147147

doc/designguidelines/readme.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ var dictionarySuggest = Rx.Observable.fromEvent(input, 'keyup')
6969
.map(function () { return input.value; })
7070
.filter(function (text) { return !!text; })
7171
.distinctUntilChanged()
72-
.throttle(250)
72+
.debounce(250)
7373
.flatMapLatest(searchWikipedia)
7474
.subscribe(
7575
function (results) {
@@ -88,9 +88,9 @@ RxJS creates an observable sequence that models an existing `keyup` event on the
8888

8989
It then places several filters and projections on top of the event to make the event only fire if a unique value has come through. (The `keyup` event fires for every key stroke, so also if the user presses left or right arrow, moving the cursor but not changing the input text).
9090

91-
Next it makes sure the event only gets fired after 250 milliseconds of activity by using the `throttle` operator. (If the user is still typing characters, this saves a potentially expensive lookup that will be ignored immediately).
91+
Next it makes sure the event only gets fired after 250 milliseconds of activity by using the `debounce` operator. (If the user is still typing characters, this saves a potentially expensive lookup that will be ignored immediately).
9292

93-
In traditionally written programs, this throttling would introduce separate callbacks through a timer. This timer could potentially throw exceptions (certain timers have a maximum amount of operations in flight).
93+
In traditionally written programs, this debouncing would introduce separate callbacks through a timer. This timer could potentially throw exceptions (certain timers have a maximum amount of operations in flight).
9494

9595
Once the user input has been filtered down it is time to perform the dictionary lookup. As this is usually an expensive operation (e.g. a request to a server on the other side of the world), this operation is itself asynchronous as well.
9696

@@ -268,12 +268,12 @@ A marble-diagram is a diagram that shows event occurring over time. A marble dia
268268

269269
<img src="https://github.com/Reactive-Extensions/RxJS/blob/master/doc/designguidelines/images/throttleWithTimeout.png" alt="throttleWithSelector">
270270

271-
By drawing the diagram we can see that we will need some kind of delay after the user input, before firing of another asynchronous call. The delay in this sample maps to the `throttle` operator. To create another observable sequence from an observable sequence we will use the `flatMap` or `selectMany` operator. This
271+
By drawing the diagram we can see that we will need some kind of delay after the user input, before firing of another asynchronous call. The delay in this sample maps to the `debounce` operator. To create another observable sequence from an observable sequence we will use the `flatMap` or `selectMany` operator. This
272272
will lead to the following code:
273273

274274
```js
275275
var dictionarySuggest = userInput
276-
.throttle(250)
276+
.debounce(250)
277277
.flatMap(function (input) { return serverCall(input); });
278278
```
279279

@@ -330,7 +330,7 @@ By using the `observeOn` operator, an action is scheduled for each message that
330330
#### Sample ####
331331

332332
```js
333-
var result = xs.throttle(1000)
333+
var result = xs.debounce(1000)
334334
.flatMap(function (x) {
335335
return ys.takeUntil(zs).sample(250).map(function (y) { return x + y });
336336
})

doc/gettingstarted/testing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ test('buffer should join strings', function () {
5959
var results = scheduler.startWithTiming(
6060
function () {
6161
return input.buffer(function () {
62-
return input.throttle(100, scheduler);
62+
return input.debounce(100, scheduler);
6363
})
6464
.map(function (b) {
6565
return b.join(',');

examples/autocomplete/autocomplete.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
.filter(function (text) {
2626
return text.length > 2; // Only if the text is longer than 2 characters
2727
})
28-
.throttle(750 /* Pause for 750ms */ )
28+
.debounce(750 /* Pause for 750ms */ )
2929
.distinctUntilChanged(); // Only if the value has changed
3030

3131
var searcher = keyup.flatMapLatest(searchWikipedia);

0 commit comments

Comments
 (0)