andrewosh / mountable-hypertrie

A Hypertrie wrapper that supports mounting of other Hypertries
MIT License
26 stars 9 forks source link

fix ready listener not triggering when using a feed which is already ready #1

Closed poga closed 4 years ago

poga commented 4 years ago

I found the issue when investigating https://github.com/mafintosh/hyperdrive/issues/241.

When we checkout a new hypertrie, a new MountableHypertrie is created and a new ready listeners is attached on the feed. However, when the feed is already ready, the once callback will never be called.

Changing it to ready(cb) will make sure the callback will always be triggered.

andrewosh commented 4 years ago

Thanks for the fix @poga! Merging