yjs / y-monaco

Monaco editor bindings for Yjs
MIT License
168 stars 33 forks source link

After manual destruction, don't destroy again on model disposal #21

Closed haines closed 1 year ago

haines commented 1 year ago

destroy doesn't remove the onWillDispose event handler from the model. This means that after a binding is manually destroyed, it will be destroyed again when the model is disposed.

This doesn't break anything but it does cause annoying console.errors from Yjs:

[yjs] Tried to remove event handler that doesn't exist. 
dmonad commented 1 year ago

Nice catch, thanks!

haines commented 1 year ago

No problem! Thanks for the quick turnaround 🚀