Skip to content

Commit

Permalink
md目录
Browse files Browse the repository at this point in the history
  • Loading branch information
yibuyisheng committed Jul 17, 2015
1 parent c7d172e commit 5eb405b
Show file tree
Hide file tree
Showing 92 changed files with 21 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

# 目录

[点此处](./index.md)
[点此处](./md/index.md)

# 《 Exploring ES6 》原书的 changelog 地址:

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
19 changes: 19 additions & 0 deletions md/21.4.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
## 21.4 用作观察者的生成器(数据消费)

作为数据消费者,生成器对象遵循生成器接口的后半部分, `Observer`

```js
interface Observer {
next(value? : any) : void;
return(value? : any) : void;
throw(error) : void;
}
```

作为一个观察者,生成器处于暂停状态,直到有输入进来。有三种类型的输入,通过接口中声明的方法来传入数据:

* `next()` 传入正常的输入数据。
* `return()` 终止生成器。
* `throw()` 发出一个出错信号。


File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion index.md → md/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@
* 21.1 [概览](./21.1.md)
* 21.2 [什么是生成器?](./21.2.md)
* 21.3 [用作迭代器的生成器(数据生产)](./21.3.md)
* 21.4 作为观察者的生成器(数据消费)
* 21.4 [用作观察者的生成器(数据消费)](./21.4.md)
* 21.5 作为协同器的生成器(多任务协作)
* 21.6 生成器示例
* 21.7 在遍历 API 内集成(包括生成器)
Expand Down

0 comments on commit 5eb405b

Please sign in to comment.