Open dfreire opened 6 years ago
Actually, my bad!!
After reading more docs I finally realized the problem was in not using encoding-down
Fixed my setup:
// setup with indexedDB
const Gun = require('gun-level');
const levelup = require('levelup');
const leveldown = require('level-js');
const encode = require('encoding-down');
const db = leveldown('my-big-db');
const gun = Gun({
localStorage: false,
level: levelup(encode(db, { valueEncoding: 'json' })),
});
Furthermore, the db.status = 'unknown';
hack is no longer necessary 👍
Is this working @dfreire ?
Yes, the issue can be closed (as it was not an issue).
However, maybe the snippet above could placed somewhere to document the explicit case of using indexeddb in the browser?
That is a great idea, could you make a PR to the README of this repo? Then I'll accept it!
I detected a problem when trying to use gun in the browser with indexeddb. Apparently, I cannot get data from a node after a browser refresh.
This is the localStorage implementation, which works fine:
This is the indexeddb implementation, which has the problem: (same thing with level-js and fruitdown)