-
Notifications
You must be signed in to change notification settings - Fork 90
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
WIP: feature hookable #455
base: master
Are you sure you want to change the base?
Conversation
I'll proceed once we resolve all questions and API is approved |
I've been looking for a feature like this. It's great for adding before and after assertions on the action. Hope we can move forward with this. |
@san650 What's your thoughts on this? |
@artemgurzhii I think its a great! I would love to see this feature in master. Can you rebase and fix the tests? CI is failing |
@san650 sure, I will work on it during those weekends and hope this will be ready by Monday. What about the second question? Do you think there is any possible use case for the async hooks? |
No that I can think of, but I'll let you know if something comes to mi mind. Thanks!! |
const fn = descriptor.get.call(this, key); | ||
|
||
return function() { | ||
// Async before and after hooks? Any use case for that? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe async should be a first class citizen cause events/actions often cause async jobs. So you probably typically want to give validations to re-compute after
you blur an input.
Not sure whether we want to support sync.. Are there any exampes for sync behavior?
|
||
return function() { | ||
// Async before and after hooks? Any use case for that? | ||
hooks.before(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it could be invoked the same way fn.call(this, ...args)
does, otherwise it's doesn't seem to be useful, cause no access to the current node instance on which it was invoked,..
db0e56e
to
64d0023
Compare
Issue
TODO:
before
andafter
hooks?@san650 Is there any other use cases that I need to make sure works correctly?
For what I see, the use case only exists for the
clickable/fillable
functions, but with this API it can be used with all functions passing functions as hooks