Skip to content

Instantly share code, notes, and snippets.

@maranomynet
Last active August 29, 2015 14:25
Show Gist options
  • Select an option

  • Save maranomynet/f138d874f296be3752df to your computer and use it in GitHub Desktop.

Select an option

Save maranomynet/f138d874f296be3752df to your computer and use it in GitHub Desktop.
Feature wrapper for Mithril.js
@barneycarroll
Copy link
Copy Markdown

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
Copy Markdown
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
Copy Markdown
Author

Changed.

@maranomynet
Copy link
Copy Markdown
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
Copy Markdown
Author

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