Closed mafintosh closed 2 years ago
Would be nice to assume a promise based core instead also. You can easily do that with streamx using this pattern:
async _open (cb) {
try {
await this._openPromise()
} catch (err) {
return cb(err)
}
cb()
}
Yep makes sense -- FYI for anyone following along the v2 branch gets rid of the hypercore-promisifier entirely and assumes that you're using Hypercore 10 (with the Promises API).
fixed in master
The read/write streams call toCallback on each creating. That method (if a promise hypercore is used) allocates listeners that are here never freed.
Can we make it so the toCallback happens once in the main constructor instead?