Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Persist data across page reloads / multiple browsers #3

Open
chmanie opened this issue Nov 20, 2017 · 0 comments
Open

Persist data across page reloads / multiple browsers #3

chmanie opened this issue Nov 20, 2017 · 0 comments

Comments

@chmanie
Copy link

chmanie commented Nov 20, 2017

Hello Pedro, thanks again for building this. I was wondering if it's possible to use this as an actual database to persist data across sessions. I might be confused about the inner workings of this or I am mistaking it for something different entirely. Currently I'm using Memdown as the log storage and levelup to access the leveldown API like this:

const Tevere = require('tevere');
const Memdown = require('memdown');
const levelup = require('levelup');

const db = Tevere('coolpartition', {
  log: Memdown('coolpartition'),
});

const tevere = levelup(db);

tevere.put('boo', 'foo', (err) => {
  console.log(err);
});

// This is being done after a page reload
tevere.get('boo', (err, val) => {
  console.log(err);
  console.log(val);
});

but I'm getting a Not Found error when getting the key after a page refresh.

Is it possible to persist the data across sessions and browsers? How's the log db actually used?

Furthermore I'm getting this error when running the above script:

Uncaught Error: no protocol with name: p2p-webrtc-star
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant