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
It seems that the only way to keep track of changes to props in component (e.i. why patch was called) is to put old data on DOM object custom property, which seems wrong.
Would it makes sense to pass old props / content to patch method of custom component? Something like componentInstance.patch(domNode, newProps, newContent, oldProps, oldContent). This way developer could figure out what exactly has changed and apply targeted patch on DOM.
I realize this leads to a wider topic of component internal state, which defeats the purpose of micro library. You probably want to keep it simple. On the other hand old props and content are available when patch is called anyway, so why not?
I could make a PR if you think this is a good idea.
The text was updated successfully, but these errors were encountered:
That's a good idea. The only disadvantage is that it's a breaking change from current API. So, you might have to bump major/minor version after this change.
It seems that the only way to keep track of changes to props in component (e.i. why
patch
was called) is to put old data on DOM object custom property, which seems wrong.Would it makes sense to pass old props / content to
patch
method of custom component? Something likecomponentInstance.patch(domNode, newProps, newContent, oldProps, oldContent)
. This way developer could figure out what exactly has changed and apply targeted patch on DOM.I realize this leads to a wider topic of component internal state, which defeats the purpose of micro library. You probably want to keep it simple. On the other hand old props and content are available when
patch
is called anyway, so why not?I could make a PR if you think this is a good idea.
The text was updated successfully, but these errors were encountered: