brezyl
brezyl

Reputation: 85

What is the desired behaviour of gun.map() on root node?

The result of using:

var gun = Gun({ peers: ['http://something/gun'] });
gun.map(()=>{})
// or
gun.map().on(()=>{})

in gun 0.2020.430 is writing to localStorage the names of the (root?!) nodes prefixed with undefined.

Because of the prefix, I suppose it is a bug, but the result should be without the prefix or nothing at all?

I suppose, nothing at all would be a better option, because it would prevent possible rough behaviors, like overwriting all the data... but?

Upvotes: 0

Views: 133

Answers (1)

marknadal
marknadal

Reputation: 7624

Currently, it is intended to do nothing.

In the future, I'd be cool to support it mapping over EVERYTHING, but that is obviously a very resource/time-consume thing to do, and probably a bad idea.

Upvotes: 0

Related Questions