-
Notifications
You must be signed in to change notification settings - Fork 2
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
[gem] Use decorators instead lifetime method #159
Labels
Comments
|
Closed
mantou132
added a commit
that referenced
this issue
Aug 5, 2024
mantou132
added a commit
that referenced
this issue
Aug 5, 2024
mantou132
added a commit
that referenced
this issue
Aug 5, 2024
mantou132
added a commit
that referenced
this issue
Aug 5, 2024
应该同时保存生命周期和装饰器?,装饰器多了一行: 如果通过编译,可以按命名约定省区装饰器:#118 @customElement('dy-chart')
class DyChartElement extends GemElement {
@effect([] => [])
#fetch = () => {}
@template()
#content = () => {
return html`content`
}
@fallback()
#errorBoundary = () => {
return html``
}
} @customElement('dy-chart')
class DyChartElement extends GemElement {
@effect([] => [])
#fetch = () => {}
render= () => {
return html`content`
}
fallback = () => {
return html``
}
} function DyChart() {
useEffect(() => {
}, [])
if (xxx) {
return <></>
}
return <>content</>
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Old:
New:
easy to extends
@willMount
@mounted
@shouldUpdate
@template
@updated
@unmounted
@effect
@memo
https://github.com/tc39/proposal-decorators?tab=readme-ov-file#will-decorators-let-you-access-private-fields-and-methods
tc39/proposal-decorators#509
microsoft/TypeScript#59482
test fail and example error: evanw/esbuild#3866
The text was updated successfully, but these errors were encountered: