This commit is contained in:
Zhicheng Wang 2016-07-26 08:16:57 +08:00
parent 3233fc4a76
commit ed8b3cd9e0

View File

@ -744,8 +744,8 @@ block observables-section
If we passed every user keystroke directly to the `HeroSearchService`, we'd unleash a storm of http requests.
Bad idea. We don't want to tax our server resources and burn through our cellular network data plan.
如果我们直接把每一次用户按键都直接传给`HeroSearchService`就会发起一场Http请求风暴。
这可不好玩。我们不希望占用服务器资源,不想耗尽网络带宽。
如果我们直接把每一次用户按键都直接传给`HeroSearchService`就会发起一场Http请求风暴。
这可不好玩。我们不希望占用服务器资源,不想耗尽网络带宽。
Fortunately we can chain `Observable` operators to the string `Observable` that reduce the request flow.
We'll make fewer calls to the `HeroSearchService` and still get timely results. Here's how:
@ -803,7 +803,7 @@ block observables-section
We are content for now to discard unwanted results.
注意_取消_`HeroSearchService`的可观察对象并不会实际中止abort一个未完成的http请求除非有一天我们支持了这个特性这个问题我们以后再讨论。
目前我们的任务只是丢弃不希望的结果。
目前我们的做法只是丢弃不希望的结果。
:marked
* `catch` intercepts a failed observable.
@ -913,7 +913,7 @@ block filetree
:marked
## Home Stretch
## 最后的坦途
## 最后冲刺
We are at the end of our journey for now, but we have accomplished a lot.