diff --git a/README.md b/README.md index 400d5e2e..d4a27dd7 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,9 @@ GUN is a realtime, distributed, offline-first, graph database engine. Lightweight and powerful, at just **~9KB** gzipped. + +[![1 minute demo of fault tolerance](http://img.youtube.com/vi/-i-11T5ZI9o/0.jpg)](https://youtu.be/-i-11T5ZI9o) + ## Why? - **Realtime** - It may be trivial to get realtime updates with socket.io or something, but what you do not get is *state synchronization*. GUN does this for you out of the box, assuring that two users' simultaneous updates won't concurrently break each other. diff --git a/gun.js b/gun.js index 45c1882e..008d8b4c 100644 --- a/gun.js +++ b/gun.js @@ -1132,7 +1132,7 @@ }; console.debug = function(i, s){ return (Gun.log.debug && i === Gun.log.debug && Gun.log.debug++) && root.console.log.apply(root.console, arguments), s }; Gun.log.count = function(s){ return Gun.log.count[s] = Gun.log.count[s] || 0, Gun.log.count[s]++ } -}()); +}.bind(this || module)()); ;(function(Tab){ @@ -1147,7 +1147,7 @@ s.del = function(key){ return store.removeItem(key) } var store = this.localStorage || {setItem: function(){}, removeItem: function(){}, getItem: function(){}}; exports.store = s; - }(Tab)); + }.bind(this || module)(Tab)); Gun.on('opt').event(function(gun, opt){ opt = opt || {}; @@ -1432,4 +1432,4 @@ } return r; }()); -}({})); \ No newline at end of file +}.bind(this || module)({})); \ No newline at end of file