mirror of
https://github.com/amark/gun.git
synced 2025-06-06 14:16:44 +00:00
Support load
plugin in node
Relying on `Gun` being globally available is not valid in most cases where a module loader is being used to import the `load` plugin. Instead, pull `Gun` from window if window is defined, otherwise require it using the module loader.
This commit is contained in:
parent
16d9a42ff8
commit
5514e00b7a
@ -1,4 +1,8 @@
|
||||
var Gun = Gun || require('../gun');
|
||||
if(typeof window !== "undefined"){
|
||||
var Gun = window.Gun;
|
||||
} else {
|
||||
var Gun = require('gun/gun');
|
||||
}
|
||||
Gun.chain.open || require('gun/lib/open');
|
||||
|
||||
Gun.chain.load = function(cb, opt, at){
|
||||
|
Loading…
x
Reference in New Issue
Block a user