-
Notifications
You must be signed in to change notification settings - Fork 57
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
update(old, new) #9
Comments
That could be done by using var bel = require('bel')
var element = bel`<div>hello</div>`
// ... later ...
var morphdom = require('morphdom')
var newelement = bel`<div>changed</div>`
morphdom(element, newelement) But I have it tied to the element to encourage data down, actions up. I'd be worried about elements getting updated by multiple sources and conflicting with each other. |
It is surprising to me for real dom elements to have extra methods on them, but it totally makes sense why you're going that way! |
I considered replacing Maybe better wording would be, "almost pure elements." :) |
Any thoughts on trasitioning update to being a function that takes the old element as it's first argument, instead of adding a property to the element? It feels like it would fit better with my expectations approaching the interface. And it seems like you could then update elements not created by bel, which would be nice.
The text was updated successfully, but these errors were encountered: