-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
feat: lifecycle base class #3581
Conversation
PR title 应该是 feat 了,实现了 #3454 这个 RFC |
return this[WORKER]; | ||
} | ||
|
||
get agent() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这样实现的话,this.app 和 this.agent 都可以取到值?是不是可以根据 worker.type 判断一下,避免用户误用?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
直接在 constructor 里面根据类型来赋值吧?而不是 assert 报错。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
根据类型来赋值,开发者取到 undefined,有个断言提醒会不会好一点?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
也行
Codecov Report
@@ Coverage Diff @@
## master #3581 +/- ##
======================================
Coverage 100% 100%
======================================
Files 32 34 +2
Lines 921 988 +67
======================================
+ Hits 921 988 +67
Continue to review full report at Codecov.
|
b7af099
to
16abfd1
Compare
覆盖率那个看看?然后可以合并了。 |
5944380
to
56918d4
Compare
@atian25 可以合了 |
|
||
class EggAgentHook extends BaseHookClass { | ||
configDidLoad() { | ||
this.agent._wrapMessenger(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Checklist
npm test
passesAffected core subsystem(s)
Description of change
Fixes: