once()
only returns the first level deep by default. You have 2 options here:once()
method with load()
(it's documented in the docs https://gun.eco/docs/API#-extended-api- )Loads the full object once. It is the same as open but with the behavior of once.
as
in most of my codebase is a pass-thru object from one function scope to another function scope (most people use this
but it has some performance penalties when used with call/apply). So you'll see as
often has as.opt
and other temporary/scope data....on(function(data){ this.get(data.subitem).once(...
if you have SEA it bundles a promise you can use instead of once. Tho it'd be nice if you'd be willing to screencall with me for us to work on .open(
? Fix it for manhattan ( + @KenEucker )import * as SEA from 'gun/sea';
const gun = SEA.GUN(gunHosts);
// hang here, no callback
gun.user().auth('username', 'pass', (res) => {
console.log('result!', res);
}));