Functional example of decorators?
See original GitHub issueWe are trying to use http://inversify.io/, it uses attribute decorators to inject:
constructor(@inject(TYPES.Repository) repository) {
}
but if I try to use mobX
configuration (add decorator support), I am still getting:
Module parse failed: Unexpected character '@' (41:21)
You may need an appropriate loader to handle this file type.
| /*#__PURE__*/
| function () {
> function TestUsage(@inject(TYPES.Test)
| test) {
| _classCallCheck(this, TestUsage);
I think this issue is caused by the configuration of webpack in CRA, they are not using ts-loader, but I am not sure.
Issue Analytics
- State:
- Created 5 years ago
- Comments:13 (7 by maintainers)
Top Results From Across the Web
Primer on Python Decorators
By definition, a decorator is a function that takes another function and extends the behavior of the latter function without explicitly modifying it....
Read more >Python Decorators (With Examples) - Programiz
In Python, a decorator is a design pattern that allows you to modify the functionality of a function by wrapping it in another...
Read more >Decorators in Python - GeeksforGeeks
Decorators are a very powerful and useful tool in Python since it allows programmers to modify the behaviour of a function or class....
Read more >How to Create and Use Decorators in Python With Examples
Python decorators allow you to change the behavior of a function without modifying the function itself. In this article I will show you...
Read more >Understanding Python Decorators, with Examples - SitePoint
A function decorator in Python is just a function that takes in another function as an argument, extending the decorated function's ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thank you, this did solve my problem. I originally planned to use mobx directly without using the decorator.
@patricklafrance thank you it did work for me