natemoo-re / micromorph

A very tiny library for diffing DOM nodes

Home Page:https://stackblitz.com/edit/micromorph-demo

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Export `diff`, `patch` functions

Monkatraz opened this issue · comments

commented

Heya, this is a cool, tiny library - thanks for making it. I've used it to replace our usage of MorphDOM in our editor's live preview system. One thing I wish I had access to was the diff and patch functions - currently you can only use the convenience function for doing both at the same time.

The reason why I would want to do this is so that I could spread out the diffing and patching process over time so I can prevent stuttering in the editor. It would also be neat to have some manual control over the patching.

I can definitely expose them both! Wasn’t sure if there was a good case for using them individually, but that makes a lot of sense.

As for more control over patching, I’m currently experimenting with different ways to expose hooks into the diff and/or patch process. Would you mind opening another issue with more details of your use cases?

commented

I actually meant "Another reason this feature would be nice would be because it would give you some more manual control", I used bad wording. I don't actually think I have any particular desire for hooks in the patch or diff functions yet. I'll definitely make a separate issue and describe in detail what we're doing if a need for hooks crops up.