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

Add function decorators #35

Open
Richienb opened this issue May 31, 2020 · 2 comments
Open

Add function decorators #35

Richienb opened this issue May 31, 2020 · 2 comments

Comments

@Richienb
Copy link
Contributor

Function decorators could be used like so:

const pRetry = require('p-retry');

class Example {
  @pRetry.Decorator()
  static async retriableFunction() {
    //...
  }
}
@sindresorhus
Copy link
Owner

Decorators are experimental in TS and behind a flag: https://www.typescriptlang.org/docs/handbook/decorators.html I think it would be better to wait until it's at least at stage 4.

@Richienb
Copy link
Contributor Author

👍

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

No branches or pull requests

2 participants