Bind decorator expects 3 parameters
hakimio opened this issue · comments
I'm submitting a...
[ ] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report
[ ] Feature request
[ ] Documentation issue or request
Current behavior
Trying to use @bind
decorator without any arguments results in "Expected 3 arguments but got 0" TypeScript error.
Expected behavior
@bind()
decorator should work without any arguments.
Minimal reproduction of the problem with instructions
Try to use @bind()
decorator in Angular 9 project.
Environment
helpful-decorators version: 2.0.6
Browser:
- [x] Chrome (desktop) version XX
For Tooling issues:
- Node version: 12
- Platform: Windows
Others:
TypeScript: 3.8.3
You're welcome to submit a PR. Thanks.
I think the only thing you have to do to fix this is wrap it in another function:
export function bind() {
return function (target: any, key: string, descriptor: PropertyDescriptor): PropertyDescriptor {
// ...
}
}
Works fine
Ok, sorry, it works without paranthesis.