Open yf-yang opened 3 months ago
Calling .unref() is just fine, but sometimes it could be forgotten and cause memory leaks.
.unref()
TC39 stage 3 proposal https://github.com/tc39/proposal-explicit-resource-management is aimed at solving the problem. We can add a [Symbol.dispose]() method to those pathRef, pointRef, rangeRef to keep up with the spec.
pathRef
pointRef
rangeRef
The only possible problem here is that we don't know how Symbol.dispose is supported in different js runtimes. I believe latest browsers and node has already supported it, but not sure about previous versions. Can't find the info in CanIUse, either.
Seems related to https://github.com/ianstormtaylor/slate/issues/5726
Nope, just a standard compatible API
Calling
.unref()
is just fine, but sometimes it could be forgotten and cause memory leaks.TC39 stage 3 proposal https://github.com/tc39/proposal-explicit-resource-management is aimed at solving the problem. We can add a [Symbol.dispose]() method to those
pathRef
,pointRef
,rangeRef
to keep up with the spec.The only possible problem here is that we don't know how Symbol.dispose is supported in different js runtimes. I believe latest browsers and node has already supported it, but not sure about previous versions. Can't find the info in CanIUse, either.