Also support the hyperscript-helpers syntax with a Proxy #73
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 PR adds native support for the hyperscript-helpers syntax with only a few more lines of code, using a Proxy object. The idea was also inspired by https://stackoverflow.com/a/40075864/645498
Usage example:
Actually I also submitted a similar PR on hyperscript-helpers, but I thought that since it's so little code, I could try here too :)
Many tests fail, but it also happens on the current master branch, see #68, so I've verified that this patch works with other custom scripts.
I'm not sure if I've given enough credit to the hyperscript-helpers contributors with the comment in the code: if you like this patch we may find better ways solve that issue. Also, if merged, the docs should be changed, and in that case I'll help too of course. Cheers!