Created
March 12, 2016 05:11
-
-
Save PsychoLlama/5894445f48254f6f3f00 to your computer and use it in GitHub Desktop.
IndexedDB with gun-level
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>IndexedDB Stuff</title> | |
<meta charset="utf-8"> | |
</head> | |
<body> | |
<h1>IndexedDB through gunDB</h1> | |
<script src="bundle.js"></script> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Gun = require('gun-level'); | |
// so you can experiment in the browser | |
window.gun = new Gun({ | |
level: { | |
// sets the "down" implementation | |
down: require('fruitdown') | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// use with json-loader for best results | |
var webpack = require('webpack'); | |
module.exports = { | |
entry: './index.js', | |
output: { | |
filename: 'bundle.js' | |
}, | |
/* | |
Required to compile properly | |
(I'll look into making this seemless) | |
*/ | |
plugins: [ | |
new webpack.IgnorePlugin(/(gun\/lib\/wsp|fs)/) | |
], | |
/* | |
Will work without, but with warnings. | |
Warnings make me uncomfortable. | |
*/ | |
module: { | |
loaders: [{ | |
test: /\.json$/, | |
loader: 'json' | |
}] | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment