mirror of
https://github.com/amark/gun.git
synced 2025-03-30 15:08:33 +00:00
Merge pull request #376 from swhgoon/patch-1
load Gun once in NW.js's JavaScript Contexts
This commit is contained in:
commit
b92a91b76a
6
nts.js
6
nts.js
@ -2,8 +2,10 @@
|
||||
|
||||
var env;
|
||||
if(typeof global !== "undefined"){ env = global }
|
||||
if(typeof require !== "undefined"){ var Gun = require('./gun') }
|
||||
if(typeof window !== "undefined"){ var Gun = (env = window).Gun }
|
||||
else {
|
||||
if(typeof require !== "undefined"){ var Gun = require('./gun') }
|
||||
}
|
||||
|
||||
Gun.on('opt', function(at){
|
||||
this.to.next(at);
|
||||
@ -43,4 +45,4 @@
|
||||
}; ping();
|
||||
});
|
||||
// test by opening up examples/game/nts.html on devices that aren't NTP synced.
|
||||
}());
|
||||
}());
|
||||
|
Loading…
x
Reference in New Issue
Block a user