mirror of
https://github.com/amark/gun.git
synced 2025-06-11 08:36:44 +00:00
fix SEA graph
This commit is contained in:
parent
a4d03f6d73
commit
41f53dff8d
3
gun.js
3
gun.js
@ -758,9 +758,10 @@
|
||||
function map(msg, soul){ var tmp;
|
||||
if(!msg.gun){ return }
|
||||
if((tmp = this.gun._).tag.node){
|
||||
return tmp.on('node', function(msg){ this.off();
|
||||
tmp.on('node', function(msg){ this.off();
|
||||
(msg.gun._).on('in', msg);
|
||||
}).on.on('node', msg);
|
||||
return;
|
||||
}
|
||||
(msg.gun._).on('in', msg);
|
||||
}
|
||||
|
2
gun.min.js
vendored
2
gun.min.js
vendored
File diff suppressed because one or more lines are too long
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "gun",
|
||||
"version": "0.9.3",
|
||||
"version": "0.9.4",
|
||||
"description": "Graph engine",
|
||||
"main": "index.js",
|
||||
"browser": "gun.min.js",
|
||||
|
5
sea.js
5
sea.js
@ -849,7 +849,10 @@
|
||||
check['user'+soul+key] = 1;
|
||||
if(user && (user = user._) && user.sea){
|
||||
if(pub === user.pub){
|
||||
SEA.write(val, Gun.obj.to(user.sea, {pub: user.pub, epub: user.epub}), function(data){
|
||||
SEA.write(val, Gun.obj.to(user.sea, {pub: user.pub, epub: user.epub}), function(data){ var rel;
|
||||
if(rel = Gun.val.rel.is(val)){
|
||||
(at.sea.own[rel] = at.sea.own[rel] || {})[pub] = true;
|
||||
}
|
||||
node[key] = data;
|
||||
check['user'+soul+key] = 0;
|
||||
each.end({ok: 1});
|
||||
|
@ -117,9 +117,10 @@ Gun._ = { // some reserved key words, these are not the only ones.
|
||||
function map(msg, soul){ var tmp;
|
||||
if(!msg.gun){ return }
|
||||
if((tmp = this.gun._).tag.node){
|
||||
return tmp.on('node', function(msg){ this.off();
|
||||
tmp.on('node', function(msg){ this.off();
|
||||
(msg.gun._).on('in', msg);
|
||||
}).on.on('node', msg);
|
||||
return;
|
||||
}
|
||||
(msg.gun._).on('in', msg);
|
||||
}
|
||||
|
@ -3,34 +3,29 @@
|
||||
<script src="../sea.js"></script>
|
||||
<script>
|
||||
;(function(){
|
||||
//localStorage.clear();
|
||||
localStorage.clear();
|
||||
|
||||
var gun = window.gun = Gun();
|
||||
var user = gun.user();
|
||||
|
||||
//user.create('alice', 'asdf', login);
|
||||
//login();
|
||||
get();
|
||||
user.create('alice', 'asdf', login);
|
||||
|
||||
function login(ack){
|
||||
user.auth('alice', 'asdf', read);
|
||||
}
|
||||
|
||||
function read(ack){
|
||||
console.log(ack);
|
||||
user.get('foo').put('yay!').val(write);
|
||||
console.log("login...");
|
||||
user.auth('alice', 'asdf', write);
|
||||
}
|
||||
|
||||
function write(data){
|
||||
var test = {I: "go infinitely"};
|
||||
test.bar = {yes: "please!", parent: test};
|
||||
user.get('test').put(test);
|
||||
console.log("write...");
|
||||
var alice = {name: "Alice"};
|
||||
alice.boss = {name: "Fluffy", slave: alice};
|
||||
user.get('profile').put(alice, get);
|
||||
}
|
||||
|
||||
function get(){
|
||||
//user.get('obj').get('some').val(function(data){
|
||||
gun.get('alias/alice').map().get('test').get('bar').get('parent').get('I').val(function(data){
|
||||
console.log("!!!", data);
|
||||
console.log("get...");
|
||||
user.get('profile').get('boss').get('slave').get('name').val(function(data){
|
||||
console.log("The boss's slave's name is:", data);
|
||||
})
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user