Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

第三节课预习 #6

Open
loslakers opened this issue Mar 24, 2019 · 1 comment
Open

第三节课预习 #6

loslakers opened this issue Mar 24, 2019 · 1 comment
Labels

Comments

@loslakers
Copy link

设计模式

不要过分纠结 发布/订阅模式观察者模式 的区别,这两个模式是非常相似的,也有不少文章将这两个模式统称为观察者模式,大家可以通过 exercise17 感受一下

事件模型、事件处理机制

事件代理和委托

AJAX & fetch

异步流程控制

了解 callback hell 是如何产生的,以及 Promise + async/await 为什么能避免回调地狱

callback

Promise + async/await

callbackify & promisify

思考一下:如何实现 callbackpromise 的互相转换

扩展知识,了解即可

Generator + function*

RxJS

@loslakers
Copy link
Author

作业

  1. https://github.com/FE-star/exercise20
  2. 参考 https://github.com/axios/axios/tree/master/lib/adapters ,这里是一个适配器模式例子,这里通过 http.jsxhr.js 分别适配了 nodejs 和 browser 两种应用场景,可以尝试完成基于 fetch 的适配
  3. 实现 callback 和 promise 的互相转换

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant