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
Calling editor.registerNodeType(Node) will instantiate Node's class. I find this behaviour quite unexpected, especially because onDestroy method which I suppose must be used for cleanup of Node's dependencies wasn't called.
Is it really necessary to instantiate the class? Can't "category" and "title" be static properties?
At least it should be documented because anything what is created inside constructor and not cleaned may potentially live forever (in my case it was websocket client polling for connections).
The text was updated successfully, but these errors were encountered:
Unfortunately, abstract static properties are currently not supported in TypeScript (microsoft/TypeScript#34516). I could use static properties but this would not be enforced by the type system, so I opted for this approach instead. But I'll add some more documentation to emphasize the fact that the constructor is called during node registration.
Calling
editor.registerNodeType(Node)
will instantiate Node's class. I find this behaviour quite unexpected, especially becauseonDestroy
method which I suppose must be used for cleanup of Node's dependencies wasn't called.Is it really necessary to instantiate the class? Can't "category" and "title" be static properties?
At least it should be documented because anything what is created inside constructor and not cleaned may potentially live forever (in my case it was websocket client polling for connections).
The text was updated successfully, but these errors were encountered: