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

feat: impl EggObjectLifecycle hook in decorator #119

Merged
merged 11 commits into from
May 30, 2023

Conversation

fengmk2
Copy link
Member

@fengmk2 fengmk2 commented May 26, 2023

closes #118

Checklist
  • npm test passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines
Affected core subsystem(s)
Description of change

@fengmk2 fengmk2 requested a review from killagu May 26, 2023 08:54
README.md Show resolved Hide resolved
@codecov
Copy link

codecov bot commented May 26, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.08 🎉

Comparison is base (c09aba3) 92.98% compared to head (b040c63) 93.07%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #119      +/-   ##
==========================================
+ Coverage   92.98%   93.07%   +0.08%     
==========================================
  Files         217      219       +2     
  Lines        4574     4604      +30     
  Branches      456      462       +6     
==========================================
+ Hits         4253     4285      +32     
+ Misses        321      319       -2     
Impacted Files Coverage Δ
...re/controller-decorator/src/util/MethodInfoUtil.ts 100.00% <ø> (ø)
core/common-util/index.ts 100.00% <100.00%> (ø)
core/common-util/src/TimerUtil.ts 100.00% <100.00%> (ø)
core/lifecycle/index.ts 100.00% <100.00%> (ø)
core/lifecycle/src/LifycycleUtil.ts 96.36% <100.00%> (+0.53%) ⬆️
core/lifecycle/src/decorator/index.ts 100.00% <100.00%> (ø)
core/runtime/src/impl/EggObjectImpl.ts 92.42% <100.00%> (+0.75%) ⬆️

... and 4 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

README.md Show resolved Hide resolved
@fengmk2 fengmk2 marked this pull request as ready for review May 26, 2023 13:06
@fengmk2 fengmk2 added the enhancement New feature or request label May 26, 2023
@fengmk2
Copy link
Member Author

fengmk2 commented May 28, 2023

@killagu 都实现了,可以看看。

this.called.push('postInject');
}

async init(): Promise<void> {
protected async init() {
this.called.push('init should not called');
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@killagu 这样就能将 init 释放出来又做到老代码兼容。

Copy link
Contributor

@killagu killagu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@killagu killagu added this pull request to the merge queue May 30, 2023
Merged via the queue into master with commit cced8a2 May 30, 2023
@killagu killagu deleted the life-crycle-hook-decorator branch May 30, 2023 06:52
@killagu
Copy link
Contributor

killagu commented May 30, 2023

3.8.0

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

Successfully merging this pull request may close these issues.

使用装饰器如 @SingletonProtoInit 方式来注册 init 函数
2 participants