Closed DougAnderson444 closed 3 years ago
Hey @DougAnderson444, as mentioned in #21 I don't believe this actually represents an emitter leak, because when the namespaced corestores are closed, the listeners are removed. As for the feed
event, it's currently emitted once per-core, the first time that core is loaded.
As for the feed
event only being emitted once: that onready
function you referenced is being registered on Hypercores, so while it's true that the feed
event is emitted once per core, it's definitely emitted more than once per InnerCorestore
.
Sorry for the confusion there! The MaxListenersExceededWarning
definitely shouldn't be appearing, so I'll bump max listeners on the InnerCorestore
to suppress it.
Fixed in 5.8.1
When I create several corestore namespaces using
corestore.namespace(NAMESPACE)
, I am getting this warning on this line:https://github.com/andrewosh/corestore/blob/bc35c5126eb9495e0d828d2bf365d41feb026bfd/index.js#L324
It appears that
'feed'
may only be emitted once, here?https://github.com/andrewosh/corestore/blob/bc35c5126eb9495e0d828d2bf365d41feb026bfd/index.js#L240-L243
If this is true, and emit 'feed' is no longer needed after
onready
, would it make sense to either add aremoveListener
afteronready
, or useonce
?For your consideration.