Closed sboehler closed 7 years ago
Yep. This makes sense. Could you add a test and include some documentation in the README please?
Thanks @rhys-vdw for the quick reply. I have updated my branch with a test (both run and runSync) and updated the README. Let me know if you need anything more.
Thanks @sboehler. Looks good!
Use case: Implementing a "get" method which fetches an object by certain parameters.
I am passing the user in the context object to the rules.run method. However, currently the context can't be evaluated in the conditional function of the 'maybe' clause.
This small pull request enhances the signature of the conditional function and allows the above use case to be implemented as:
Then, validation is run using
Let me know what you think, I appreciate any feedback!