Activities

jsbroks

jsbroks posted a new question

localforage-module •

How to access localForage outside of vue

How doe sone access localForage form outside of vue

transfluxus

transfluxus posted a new question

localforage-module •

Question and localforage in `modules` not `buildModules`

Hi,

Any notes on the new version? :)
I am still on 1.0.2

I am doing something typical, reloading the storage when the app is loaded. My approach so far is to put it in the create method of my default layout. obviously that is problematical since I would need to do that in all other layouts. I was thinking about doing this in an middleware, however I just noticed, that the localforage is not available in the context of the middleware. I was checking the documentation, to see if there is something about that… Doing that I realized I have localforage in modules not buildModules. However changing that, my index page doesn't load anymore…

I am doing something like this in the default layout:

    created() {
      if (!this.$store.getters[DB_LOADED]())
        reload_storage(this.$store, this.$localForage) 

db_loaded is a flag in my store which is set after localForage is loaded. Then in a watch method to that store variable I fetch stuff from the server and set another flag in the store to initialized, which will finally allows the page to be created:

      <v-container v-if="initialized">
        <nuxt/> 

There is probably a better way to do all these initial steps involving the localforage. Any guidelines would be really appreciated.

zwarag

zwarag posted a new question

localforage-module •

re-release

Could you guys re-release the plugin? It looks like the last PR was pulled but never released.
If I do a yarn add @nuxtjs/localforage and look at the lib, then I see the folder structure lib/templates which does not exist in the current release. So it looks like the newest version has not been released yet.

kght6123

kght6123 posted a new question

localforage-module •

When will the npm and yarn versions be updated ?

I want to use localforage in Vuex Store.
npm and yarn versions are not updated
I can't use it.

https://www.npmjs.com/package/@nuxtjs/localforage

ricardogobbosouza

ricardogobbosouza posted a new feature request

localforage-module •

idea Run Codecov on PRs

What problem does this feature solve?

Run Codecov on PRs

ricardogobbosouza

ricardogobbosouza posted a new feature request

localforage-module •

idea Run CircleCI on PRs

What problem does this feature solve?

Run CircleCI on PRs

ricardogobbosouza

ricardogobbosouza posted a new question

localforage-module •

Run CircleCI on PRs

Nothing to preview

randyhoulahan

randyhoulahan posted a new question

localforage-module •

How to do I make a PR for you to review?

I have updated your module to allow multiple instances via config. Also injected into Vuex. Excuse my ingnirance. Trying to save some minutes.

randyhoulahan

randyhoulahan posted a new question

localforage-module •

How to do I make a PR for you to review?

I have updated your module to allow multiple instances via config. Also injected into Vue. Excuse my ingnirance. Trying to save some minutes.

randyhoulahan

randyhoulahan posted a new question

localforage-module •

Feature
  • allow for multiple instances defined in config.
  • inject into vuex

I have done this. How can I do a PR for you to review?

besnikh

besnikh posted a new question

localforage-module •

How to use localForage with Vuex ?

Hi,

I am able to use local forage as a method, but I can not use it in store.. I tried different options but I could not manage to do it.

As a method, this is what I am doing

async localForage () {
      let data = {
        name: 'test',
        operation: 'Nav-Business'
      }
      await this.$localForage.setItem('nav', data)
        .then(data => {
          console.log('Working', data)
        })
        .catch(error => {
          console.log(error)
        })
    }

Thnx in advance

AndrewBogdanovTSS

AndrewBogdanovTSS posted a new question

localforage-module •

How to access localForage instance from the store?

I want to have access to localForage instance from the Nuxt store, but in provided docs I only found examples related to accessing the instance via this.$localForage in components, but how can it be accessed in store?

marceloavf

marceloavf posted a new question

localforage-module •

ReferenceError: localforage is not defined

Installed @nuxtjs/localforage normally

Actual code:

  modules: [
    // Doc: https://github.com/nuxt-community/axios-module#usage
    '@nuxtjs/axios',
    ['@nuxtjs/localforage', {
      driver: localforage.LOCALSTORAGE,
    }]
  ],

Error:

driver: localforage.LOCALSTORAGE,
            ^

ReferenceError: localforage is not defined
    at Object.<anonymous> (D:\xampp\htdocs\suporteps-extension\nuxt.config.js:56:13)
    at Module._compile (module.js:635:30)
    at Object.Module._extensions..js (module.js:646:10)
    at Module.load (module.js:554:32)
    at tryModuleLoad (module.js:497:12)
    at Function.Module._load (module.js:489:3)
    at Module.require (module.js:579:17)
    at require (internal/module.js:11:18)
    at exports.loadNuxtConfig.argv (D:\xampp\htdocs\suporteps-extension\node_modules\nuxt\bin\common\utils.js:18:15)
    at Object.<anonymous> (D:\xampp\htdocs\suporteps-extension\node_modules\nuxt\bin\nuxt-dev:63:20)
    at Module._compile (module.js:635:30)
    at Object.Module._extensions..js (module.js:646:10)
    at Module.load (module.js:554:32)
    at tryModuleLoad (module.js:497:12)
    at Function.Module._load (module.js:489:3)
    at Module.require (module.js:579:17)
error An unexpected error occurred: "Command failed.