This repository was archived by the owner on Oct 1, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 61
docs(89): brings content for documentation of debounceTime-operator #138
Merged
ashwin-sureshkumar
merged 4 commits into
ReactiveX:master
from
zualexander:feature/89-operator-debounceTime
Nov 17, 2017
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
17315b7
docs(89): brings content for documentation of debounceTime-operator
zualexander 423b35a
docs(debounceTime): adds missed closing paren and adds code-markdown …
zualexander 177bb76
Merge branch 'master' into feature/89-operator-debounceTime
sumitarora b2741a7
Merge branch 'master' into feature/89-operator-debounceTime
sumitarora File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,80 @@ | ||
| import { OperatorDoc } from '../operator.model'; | ||
| import { OperatorDoc } from "../operator.model"; | ||
|
|
||
| export const debounceTime: OperatorDoc = { | ||
| 'name': 'debounceTime', | ||
| 'operatorType': 'filtering' | ||
| name: "debounceTime", | ||
| operatorType: "filtering", | ||
| signature: | ||
| "public debounceTime<T>(dueTime: number, scheduler: IScheduler = async): Observable", | ||
| parameters: [ | ||
| { | ||
| name: "dueTime", | ||
| type: "number", | ||
| attribute: "mandatory", | ||
| description: `The timeout duration in milliseconds | ||
| (or the time unit determined internally by the optional scheduler) for the window of time required to | ||
| wait for emission silence before emitting the most recent source value.` | ||
| }, | ||
| { | ||
| name: "scheduler", | ||
| type: "IScheduler", | ||
| attribute: "optional", | ||
| description: `The IScheduler to use for managing the timers that handle the timeout for each value.` | ||
| } | ||
| ], | ||
| marbleUrl: "http://reactivex.io/rxjs/img/debounceTime.png", | ||
| shortDescription: { | ||
| description: ` | ||
| Emits a value from the source Observable only after a particular time span has passed without another source emission. | ||
| It's like <a class="markdown-code" href="href="/operators#delay">delay</a> | ||
| , but passes only the most recent value from each burst of emissions.`, | ||
| extras: [] | ||
| }, | ||
| walkthrough: { | ||
| description: ` | ||
| <p> | ||
| <span class="markdown-code">debounceTime</span> delays values emitted by the source Observable, but drops | ||
| previous pending delayed emissions if a new value arrives on the source | ||
| Observable. This operator keeps track of the most recent value from the | ||
| source Observable, and emits that only when <span class="markdown-code">dueTime</span> enough time has passed | ||
| without any other value appearing on the source Observable. If a new value | ||
| appears before <span class="markdown-code">dueTime</span> silence occurs, the previous value will be dropped | ||
| and will not be emitted on the output Observable. | ||
| </p> | ||
| <p> | ||
| This is a rate-limiting operator, because it is impossible for more than one | ||
| value to be emitted in any time window of duration <span class="markdown-code">dueTime</span>, but it is also | ||
| a delay-like operator since output emissions do not occur at the same time as | ||
| they did on the source Observable. Optionally takes a <span class="markdown-code">IScheduler</span> for | ||
| managing timers. | ||
| </p> | ||
| ` | ||
| }, | ||
| examples: [ | ||
| { | ||
| name: | ||
| "Emit the most recent value after a burst of value changes over a defined time", | ||
| code: ` | ||
| const search = document.querySelector('#search'); | ||
| const output = document.querySelector('#output'); | ||
| const searchChange$ = Rx.Observable.fromEvent(search, 'keyup'); | ||
|
|
||
| searchChange$ | ||
| .map(x => x.target.value) | ||
| .debounceTime(500) | ||
| .subscribe((search)=> output.textContent=search); | ||
| `, | ||
| externalLink: { | ||
| platform: "JSBin", | ||
| url: "http://jsbin.com/gapobakuwu/edit?js,output" | ||
| } | ||
| } | ||
| ], | ||
| relatedOperators: [ | ||
| "auditTime", | ||
| "debounce", | ||
| "delay", | ||
| "sampleTime", | ||
| "throttleTime" | ||
| ], | ||
| additionalResources: [] | ||
| }; | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
think we need
declare warset lint rules between single quote to double quote.