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
Switch to a Promise interface #76
Comments
For the rules/externals? Yup, why not! Shouldn’t be very hard! |
Pretty much for everything, but was mainly thinking of the callback here: |
With the release of the master branch, in ± a few minutes, it’ll be possible to return promises from rules. It’s already possible to return promises from remark plug-ins too. However, I personally don’t want to support promises in the outward remark API, so that ( |
Awesome! Thanks for being so responsive :)
You don't have to switch though. You could easily support both. Return a promise if no callback is provided. That's a very common thing to do for authors that are not convinced about promises, but want to make it easy for anyone to use their API. |
Unfortunately not: the If that’d be possible I’d be OK with it, but I value the sync API too much! |
Having an API be sync or async depending an argument is generally considered an anti-pattern. Would be better to be explicit about with through an option or even better a separate method.
Or the inverse. |
If you want to preserve backwards compatibility, you could add a |
Currently it’s more that the plugins someone |
For the async API. Instead of a callback.
The text was updated successfully, but these errors were encountered: