Adding interface to local storage plugin

  • Ashley

    I would like to put out there that maybe adding an interface to the local storage plugin in the sdk would be useful. In one of my plugins I currently rolled my own interface to IndexDB, which I know you use for local storage. I think it would simply plugin in development if we are able to use your well used and tested interface to local storage instead of handling it ourselves. Just a thought.

    I also wanted to add that I really appreciate all the work you and your team does and I totally enjoy developing my game and plugins for construct 3.

  • Why does your plugin need to store its own data? No other Construct plugins need to do that. Keeping it separate helps ensure a clear separation of responsibilities in the engine and avoids users finding data surprisingly appearing in their own game's Local Storage data.

    The C3 runtime uses the localforage library though, so you can count on that always being available. That provides a simple way to create a separate storage database isolated from anything else in the runtime so it doesn't cause any surprising cross-referencing problems.

  • Ashley

    My plugin caches some data that allows it to easily maintain information between application runs. The default is for it to be off, but it can be switched on. I saw when I looked at the code that you were using localforage, but I didn't know if I could count on it being there if I wasn't actually using the locaol storage plugin. So I wrote my own access layer to indexdb using promises, which my plugin currently uses.

    Just thought it was an idea, but I can understand your points.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Cached data shouldn't appear in the user's LocalStorage plugin, since that should only iterate and return data that the user intended to store there. So you should use a separate storage database. Localforage makes that easy though.

  • Ashley

    Good point. Thanks

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)