amark on master
Allow Dockerfile to auto-update… (compare)
amark on master
rad fixed dup text, perf, read … (compare)
gun.on('auth')
didn't work.gun = Gun()
Gun {_: {…}}
user = gun.user()
User {_: {…}}
gun.on('auth', console.log)
Gun {_: {…}}
user.auth('numericx', '12345678')
User {_: {…}}
gun.js:198 {gun: Gun, $: Gun, root: {…}, id: 4, back: {…}, …}
user.is.pub
"yYhLaCfPklnRCAsiLYmrkqC2vPIolENLDn2ZwsTwKWk.tQ-9Z39vktnFthfYV7D07Zzy4Z_Zb37ctXr9pTEkzw0"
[D]danlugo92: actually it did work. Sorry :/.
Line gun.js:198 {gun: Gun, $: Gun, root: {…}, id: 4, back: {…}, …}
gun.on('leave')
doesn't though. maybe it's another constant?
{""+url:{url:url}}
not just empty object
[D]anoxy: @pszabop in fact it is possible to have aliases exactly as it works in Discord like anoxy#4831
. <@280426612900757504> have implemented it in his platform https://www.peersocial.io/
So by doing it that way there won't be any name collisions
—
Anyone else - is there a way to mutate a value without referencing it (e.g. gun.get(‘someitem’).get(‘views’).inc()
to increment? Maybe a custom chain method that will call a method on a node with itself as a parameter? That possibly is already written, I’m just thinking out loud here:
Gun.prototype.call( function( Function cb ) {
this.put(cb(this))
})
And then we could do:
Gun.prototype.inc( function() {
this.call( function(x) { return x++ } )
})
Gun.chain.inc = function () {
let self = this;
this.get('.').once(function(data,key){
console.log("data",data,"key",key);
if(!data) data = 0;
data = data+1;
console.log("data",data,"key",key);
return self.put({[key]:data});
});
}
// usage:
gun.get('something').get('views').inc();
// read count
gun.get('something').get('views').get('.').once(function(count){ // count should be now 1 });
Gun.chain.curval = async function(){
return await this.get('.').then();
}
//usage:
let views= await gun.get("whatever").get("inc2").curval();
// should return whatever was incremented