Skip to content

Instantly share code, notes, and snippets.

@maranomynet
Last active August 29, 2015 14:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maranomynet/f138d874f296be3752df to your computer and use it in GitHub Desktop.
Save maranomynet/f138d874f296be3752df to your computer and use it in GitHub Desktop.
Feature wrapper for Mithril.js
@barneycarroll
Copy link

Hiya @maranomynet, this looks great. Regarding the list of DOM level 0 events, might it be an idea to see whether elements can support the property dynamically? This would avoid the responsibility of having to maintain a list. The condition at line 201 would then become:

!( attrName in document.documentElement )

@maranomynet
Copy link
Author

Not maintaining a list would be great.

Is attrName in document.documentElement a safe indicator that a level 0 event type is supported?

...hmmm, I guess it must be.

@maranomynet
Copy link
Author

Changed.

@maranomynet
Copy link
Author

Actually, this event binding only worked as long as the event handlers didn't change over the lifetime of the element. Now they should update dynamically.

I also changed how it handles cases where transformation functions return a replacement node

@maranomynet
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment