You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a work in progress of allowing to call hooks on various events; So far, I've added the hooks, and events of "error", "success" and "always", called in the done() function.
There are no tests yet, but I will add them if/when we iron out naming/existence of this feature and its parts.
Thanks and sorry for being silent for so long! I think this looks good, as it solves your use case from #238. But I don't see a need for the always hook. Couldn't this just be called next to the form execution?
@mzur No problem at all! This is open source after all! (and uniform isn't the only plugin I'm using patched from a custom repo 🦅 )
Since I based the naming originally on github, I just included the always hook as well. But looking at the order of execution now, if you have a standard "flash/redirect" form and a code like this:
the doCustomStuff never gets called, because done() redirects the page at that point.
->on('always') on the other hand gets called (You also create a compact form definition code block, but that in itself prob wouldn't be a sufficient argument)
Update: interestingly, if you don't add the ->done() call (manually), the hooks don't get called in case of success, but the form works (and the doCustomStuff() gets called)
I don't know what to make of it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a work in progress of allowing to call hooks on various events; So far, I've added the hooks, and events of "error", "success" and "always", called in the
done()function.There are no tests yet, but I will add them if/when we iron out naming/existence of this feature and its parts.