mirror of
https://github.com/amark/gun.git
synced 2025-06-12 17:16: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;
|
function map(msg, soul){ var tmp;
|
||||||
if(!msg.gun){ return }
|
if(!msg.gun){ return }
|
||||||
if((tmp = this.gun._).tag.node){
|
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);
|
(msg.gun._).on('in', msg);
|
||||||
}).on.on('node', msg);
|
}).on.on('node', msg);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
(msg.gun._).on('in', msg);
|
(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",
|
"name": "gun",
|
||||||
"version": "0.9.3",
|
"version": "0.9.4",
|
||||||
"description": "Graph engine",
|
"description": "Graph engine",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"browser": "gun.min.js",
|
"browser": "gun.min.js",
|
||||||
|
5
sea.js
5
sea.js
@ -849,7 +849,10 @@
|
|||||||
check['user'+soul+key] = 1;
|
check['user'+soul+key] = 1;
|
||||||
if(user && (user = user._) && user.sea){
|
if(user && (user = user._) && user.sea){
|
||||||
if(pub === user.pub){
|
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;
|
node[key] = data;
|
||||||
check['user'+soul+key] = 0;
|
check['user'+soul+key] = 0;
|
||||||
each.end({ok: 1});
|
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;
|
function map(msg, soul){ var tmp;
|
||||||
if(!msg.gun){ return }
|
if(!msg.gun){ return }
|
||||||
if((tmp = this.gun._).tag.node){
|
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);
|
(msg.gun._).on('in', msg);
|
||||||
}).on.on('node', msg);
|
}).on.on('node', msg);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
(msg.gun._).on('in', msg);
|
(msg.gun._).on('in', msg);
|
||||||
}
|
}
|
||||||
|
@ -3,34 +3,29 @@
|
|||||||
<script src="../sea.js"></script>
|
<script src="../sea.js"></script>
|
||||||
<script>
|
<script>
|
||||||
;(function(){
|
;(function(){
|
||||||
//localStorage.clear();
|
localStorage.clear();
|
||||||
|
|
||||||
var gun = window.gun = Gun();
|
var gun = window.gun = Gun();
|
||||||
var user = gun.user();
|
var user = gun.user();
|
||||||
|
|
||||||
//user.create('alice', 'asdf', login);
|
user.create('alice', 'asdf', login);
|
||||||
//login();
|
|
||||||
get();
|
|
||||||
|
|
||||||
function login(ack){
|
function login(ack){
|
||||||
user.auth('alice', 'asdf', read);
|
console.log("login...");
|
||||||
}
|
user.auth('alice', 'asdf', write);
|
||||||
|
|
||||||
function read(ack){
|
|
||||||
console.log(ack);
|
|
||||||
user.get('foo').put('yay!').val(write);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function write(data){
|
function write(data){
|
||||||
var test = {I: "go infinitely"};
|
console.log("write...");
|
||||||
test.bar = {yes: "please!", parent: test};
|
var alice = {name: "Alice"};
|
||||||
user.get('test').put(test);
|
alice.boss = {name: "Fluffy", slave: alice};
|
||||||
|
user.get('profile').put(alice, get);
|
||||||
}
|
}
|
||||||
|
|
||||||
function get(){
|
function get(){
|
||||||
//user.get('obj').get('some').val(function(data){
|
console.log("get...");
|
||||||
gun.get('alias/alice').map().get('test').get('bar').get('parent').get('I').val(function(data){
|
user.get('profile').get('boss').get('slave').get('name').val(function(data){
|
||||||
console.log("!!!", data);
|
console.log("The boss's slave's name is:", data);
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user