question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

localForage support

See original GitHub issue

Hi Arnav, first of all, thank you for releasing vuex-persist. You mention on your readme that localforage is supported. However, new VuexPersistance(storage: localforage}) doesn’t work - it surfaces an error related to localforage being asynchronous (VuexPersistance is trying to JSON decode a JS promise). Any tip how to make this work?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:4
  • Comments:13 (4 by maintainers)

github_iconTop GitHub Comments

7reactions
championswimmercommented, Aug 21, 2017

Ah, will have to make some changes for that. Let me add this to my todo.

5reactions
ulf1commented, Aug 28, 2020

@TimonPost @to-svarghese I had the same symptom rn. this helped: https://github.com/championswimmer/vuex-persist/issues/117#issuecomment-493906644

example:

import VuexPersist from 'vuex-persist';
import localForage from 'localforage'
const vuexStorage = new VuexPersist({
  ...
  storage: localForage,
  asyncStorage: true, // <<< ADD THIS
  ...
});

This should probably set as default value when VuexPersist detected that storage is localForage. @championswimmer

Read more comments on GitHub >

github_iconTop Results From Across the Web

localForage - GitHub
localForage supports storing all native JS objects that can be serialized to JSON, as well as ArrayBuffers, Blobs, and TypedArrays. Check the API...
Read more >
localForage - GitHub Pages
localForage includes a localStorage-backed fallback store for browsers with no IndexedDB or WebSQL support. Asynchronous storage is available in the current ...
Read more >
How to Use localForage for Easy Async Browser Storage
localForage is a convenient wrapper library that smoothes the rough landscape of browser databases. Of which there are several: localStorage ...
Read more >
localforage - npm
Start using localforage in your project by running `npm i localforage`. There are 1711 other projects in the npm registry using localforage.
Read more >
LocalForage - Simplified JavaScript Jargon
localForage supports storing all native JS objects that can be serialized to JSON, as well as ArrayBuffers, Blobs, and TypedArrays. Check the API...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found