huan / state-switch

State Switch is a Monitor/Guard for Managing Your Async Operations.
https://paka.dev/npm/state-switch/
Apache License 2.0
5 stars 0 forks source link

ready()函数的作用 #35

Open LuSingTea opened 4 years ago

LuSingTea commented 4 years ago
  1. ready()函数有什么作用
  2. this.onResolver()和await onPromise有什么区别
huan commented 4 years ago

What does the `ready() function do

Could you please think about the below question, and let me know your answer?

If we have no ready() function in this module, can this module does its job correctly? If the answer is no, why?

onResolver v.s. onPromise

Please provide a use case with a code example for your question to explain it in detail, so that we can discussing based on your example code.

BTW: I believe this issue is related to https://github.com/wechaty/summer-of-code/issues/4 , please correct me if I'm not right.