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

实现一个符合 Promises/A+ 规范的 Promise | HZFE - 剑指前端 Offer #67

Open
utterances-bot opened this issue Mar 3, 2022 · 5 comments

Comments

@utterances-bot
Copy link

实现一个符合 Promises/A+ 规范的 Promise | HZFE - 剑指前端 Offer

这是一道有着成熟的业界规范的 coding 题,完成这道题的前置知识就是要了解什么是 Promises/A+。

https://febook.hzfe.org/awesome-interview/book1/coding-promise

Copy link

状态机 (有限元状态机)

State machine

Copy link

有限元状态机不止这一种利用方式,这是一种编程思想,而前端的那些钩子你可以理解为状态切换的过程中调用了那些钩子函数,所谓的组件创建前,组件挂载前,组件销毁这都是状态,而每一种状态执行该状态下的方法,状态之间是可以切换的,但是不是随意切换,每一种状态可以由前一种状态切换到后一种状态,这种状态可以是可逆的,也可以是不可逆的。比如门只有这两种状态,他们是可以相互切换的,但是组件一旦从内存里销毁了,那就无法再次切换成销毁前的状态。当你用有限元状态机去理解前端框架当中的钩子,会有别样的心得。几乎是哪个地方都可以使用这种思想

Copy link

Myfyz commented Oct 28, 2022

看不懂咋办啊,这是什么水平的面试题啊,是我太菜了吗

Copy link

QiuYeDx commented Jun 15, 2023

2023年3月初 腾讯暑期实习提前批一面笔试题:尝试手写一个Promise

Copy link

我从头尾照着理解、敲了一遍,依然懵懵懂懂的

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

No branches or pull requests

5 participants