Giter Site home page Giter Site logo

Comments (6)

trakhimenok avatar trakhimenok commented on August 22, 2024

I see same duplicate log records.

from ionic-storage.

chron0 avatar chron0 commented on August 22, 2024

Dito, and, although not yet confirmed with empirical tests, I'd also agree on the sentiment that ionic-storage pulls heavy on startup time. When I used native localstorage before, it seemed way faster. But since localstorage is not an option for certain platforms/deployments it would be great to see ionic-storage perform at a similar level (ionickv/indexdb).

from ionic-storage.

chron0 avatar chron0 commented on August 22, 2024

There is some other oddity I've discovered when setting a different db/store name (other than the default _ionickv), which may have the same origin:

export function provideStorage(): any {
  return new Storage(
    [
      'sqlite',
      'indexeddb',
      'websql',
      'localstorage',
    ],
    {
      name: 'governessdb',
      storeName: 'governessdata',
    }
  );
}

[...]

export function providers(): any {
  return [
    [...]
    // Enable Ionic's storage engine
    { provide: Storage, useFactory: provideStorage },
  ];
}


@NgModule({
  [...]
  providers: providers(),
})

It still creates the _ionickv indexeddb and now half of the data is in _ionickv, while other stuff, which was triggered to write later (after init) within the applications workflow is in governessdata.

screenshot_2016-12-29_15-23-53

screenshot_2016-12-29_15-28-25

Code: https://github.com/apollo-ng/governess/tree/master/client

from ionic-storage.

mlynch avatar mlynch commented on August 22, 2024

Hmm, not able to reproduce

from ionic-storage.

chron0 avatar chron0 commented on August 22, 2024

@mlynch: Thanks for the reminder. Since you couldn't reproduce I went ahead and tried to figure it out. I haven't done a second round to re-verify but in my case it seemed to have been caused by wrapping ionic-storage into a storage provider/service and then using this in the actual data provider services.

Before there was ionic-storage I created my own storage provider to wrap native localstorage and after ionic-storage was released I just swapped my localstorage calls with ionic-storage ones.

After importing and using ionic-storage in each data provider/service instead of my own storage provider it creates only the governessdata storage instance. I have no idea why it should make a difference but it seems to do.

from ionic-storage.

mhartington avatar mhartington commented on August 22, 2024

Closing!

from ionic-storage.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.