Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>JS Bin</title>
</head>
<body>
<script src="http://rawgit.com/amark/gun/master/gun.js"></script>
<script src="http://rawgit.com/amark/gun/master/lib/open.js"></script>
<script src="http://rawgit.com/amark/gun/master/lib/later.js"></script>
</body>
</html>
 
localStorage.clear();
var gun = Gun();
var data = {
  a: 1,
  b: {c: 2}
};
data.b.z = data;
console.log("Fire after 2 seconds...");
gun.get('foo').put(data).later(function(data, key){
  console.log("Should not have 'NO!'", data);
  console.log("what is ", data.b.z.b.z.a);
  this.get('b').put(null); // expire data!
}, 2); // 2 seconds!
setTimeout(function(){
  gun.get('foo').get('b').get('d').put("YES!");
}, 1000);
setTimeout(function(){
  gun.get('foo').get('b').get('e').put("NO!");
}, 4000);
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
anonymouspro
0viewers