Coder Social home page Coder Social logo

localforage-sessionstoragewrapper's Introduction

localForage-sessionStorageWrapper

Build Status npm

A sessionStorage driver for localForage.

Requirements

  • localForage v1.5.0+ Users of earlier localForage versions (v1.2.1+) should use sessionStorageWrapper v1.2.0.

Installation

npm i localforage-sessionstoragewrapper

bower

Bower support was droppped in v1.3.0, but you can still use v1.2.0 with bower install [email protected]

Example

jsfiddle

localforage-sessionstoragewrapper's People

Contributors

dependabot[bot] avatar thgreasi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

localforage-sessionstoragewrapper's Issues

dist directory

Hi, we're installing with bower still which comes directly from github. Will you commit the dist directory as well? This is breaking us.

ES Module

Any chance we could get this as an es module like memoryStorageDriver?

clear() does not work as intended

Hi ๐Ÿ‘‹,

first of all: thanks for this library โค๏ธ

I noticed that clear() does not always remove all keys. This happens when there's another key in the SessionStorage that does not have the store prefix (in my case it was a browser extension).

The current implementation iterates over all keys and removes them if they have the store prefix. The remove operation, however, might mess with the order of keys that are returned by key(i). In my case, key(i) returned the same key for a different i. MDN writes about key():

The order of keys is user-agent defined, so you should not rely on it.

The current implementation can be fixed by first getting all the keys via Object.keys() and then iterating over that array. Object.keys() has good browser support these days but I don't know if that's ok for you. You could also iterate with for ... in.

Are you interested in a fix with Object.keys()? I could send a PR.

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.