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

Added support for fields with (arrow) functions #12

Merged
merged 2 commits into from
Apr 17, 2019

Conversation

JulianWielga
Copy link
Contributor

I updated your readme assuming that this works.

@jeffijoe
Copy link
Owner

Could you verify it works with TS as well? I remember something about Babel and TS's decorator stuff being different regarding initializers.

@JulianWielga
Copy link
Contributor Author

I've tested it in my project with @babel/typescript preset and @babel/plugin-proposal-class-properties with loose: true. Did you mean plain typescript compiler? I think it's impossible to decorate field holding function without babel.

A Property Descriptor is not provided as an argument to a property decorator due to how property decorators are initialized in TypeScript(...)
https://www.typescriptlang.org/docs/handbook/decorators.html#property-decorators

@jeffijoe
Copy link
Owner

Aha, then it should be fine

@JulianWielga
Copy link
Contributor Author

I think that if someone is using decorators or class properties holding arrow function and typescript knows what and how to do it and is prepared for problems :)

@jeffijoe
Copy link
Owner

Well, if someone encounters an issue with TS I’ll ping you 😄

Thanks for the PR, I’ll merge and publish tomorrow!

@jeffijoe jeffijoe merged commit 8d32f25 into jeffijoe:master Apr 17, 2019
@jeffijoe
Copy link
Owner

Released as 1.0.3, thanks for your contribution! 🎉

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

Successfully merging this pull request may close these issues.

2 participants