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

feat: support async rules #23

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

feat: support async rules #23

wants to merge 1 commit into from

Conversation

mblarsen
Copy link
Owner

No description provided.

@mblarsen mblarsen linked an issue Nov 13, 2020 that may be closed by this pull request
@yudikubota
Copy link

Thanks for implementing that feature
Changes and tests are OK
but what you're going to do regarding existing applications?

let's say an application expects boolean to be returned from a can() call. If we change it to async it will return a Promise and can break the existing application.

Are you going to release a separate breaking version?

@mblarsen
Copy link
Owner Author

let's say an application expects boolean to be returned from a can() call. If we change it to async it will return a Promise and can break the existing application.

Are you going to release a separate breaking version?

Yeah, that's my concern. I was thinking making a v2.0

I also considered creating a can + canSync version ala the way node fs package works. But that would still require a v2 and I'm not sure it is worth to maintain the extra complexity.

@mblarsen
Copy link
Owner Author

FYI, I made an earlier version where there were no changes to can (except I remove the Boolean() calls). That way only some, every was promise based.

The advantage of that is that it wouldn't break any apps. But you, as a user, would have to write checks on the return type. Not interested in that either.

Copy link

@yudikubota yudikubota left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code and tests are OK
just be careful about breaking changes

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.

Add support to async functions in Policies
2 participants