amark / gun

An open source cybersecurity protocol for syncing decentralized graph data.
https://gun.eco/docs
Other
17.93k stars 1.16k forks source link

[Bug] _ev.off() disables the entire .map() listener, rather than the individual item #1335

Open Vectorrent opened 10 months ago

Vectorrent commented 10 months ago

Mark asked me to open a bug report about this one. Here is some replica code:

gun.get('test')
    .get('neurons')
    .map((value, key, _msg, _ev) => {
        console.log(value)
        _ev.off()
    })

After receiving just one item, the entire .map() listener is disabled. The expected behavior is to disable the listener for just one particular item - not the entire map.

Not a huge priority for me, personally, as I've found a workaround. Would be nice if this worked, though.

amark commented 8 months ago

😭