"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "aio/content/guide/http.md" between
angular-11.0.1.tar.gz and angular-11.0.2.tar.gz

About: Angular is a development platform for building mobile and desktop web applications using Typescript/JavaScript.

http.md  (angular-11.0.1):http.md  (angular-11.0.2)
skipping to change at line 956 skipping to change at line 956
</code-example> </code-example>
The `searchText$` is the sequence of search-box values coming from the user. The `searchText$` is the sequence of search-box values coming from the user.
It's defined as an RxJS `Subject`, which means it is a multicasting `Observable` It's defined as an RxJS `Subject`, which means it is a multicasting `Observable`
that can also emit values for itself by calling `next(value)`, that can also emit values for itself by calling `next(value)`,
as happens in the `search()` method. as happens in the `search()` method.
Rather than forward every `searchText` value directly to the injected `PackageSe archService`, Rather than forward every `searchText` value directly to the injected `PackageSe archService`,
the code in `ngOnInit()` pipes search values through three operators, so that a search value reaches the service only if it's a new value and the user has stopp ed typing. the code in `ngOnInit()` pipes search values through three operators, so that a search value reaches the service only if it's a new value and the user has stopp ed typing.
* `debounceTime(500)`&emdash;Wait for the user to stop typing (1/2 second in thi s case). * `debounceTime(500)`⁠—Wait for the user to stop typing (1/2 second in this case ).
* `distinctUntilChanged()`&emdash;Wait until the search text changes. * `distinctUntilChanged()`⁠—Wait until the search text changes.
* `switchMap()`&emdash;Send the search request to the service. * `switchMap()`⁠—Send the search request to the service.
The code sets `packages$` to this re-composed `Observable` of search results. The code sets `packages$` to this re-composed `Observable` of search results.
The template subscribes to `packages$` with the [AsyncPipe](api/common/AsyncPipe ) The template subscribes to `packages$` with the [AsyncPipe](api/common/AsyncPipe )
and displays search results as they arrive. and displays search results as they arrive.
<div class="alert is-helpful"> <div class="alert is-helpful">
See [Using interceptors to request multiple values](#cache-refresh) for more abo ut the `withRefresh` option. See [Using interceptors to request multiple values](#cache-refresh) for more abo ut the `withRefresh` option.
</div> </div>
 End of changes. 3 change blocks. 
3 lines changed or deleted 3 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)