Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specify an array of preferred adapters #104

Merged
merged 1 commit into from Jan 28, 2013
Merged

Specify an array of preferred adapters #104

merged 1 commit into from Jan 28, 2013

Conversation

lukaszfiszer
Copy link
Contributor

I've added a possibility to pass an array of preferred adapter when creating a new Lawnchair object

var store = new Lawnchair({
  name:'testing', 
  adapter: ['indexed-db', 'webkit-sqlite', 'dom'] }, 
  function(store) {
    // callback
});

Lawnchair will initialize the first installed and valid adapter from the array, independently of the order in with the adapters were loaded. This permits to control fallback adapters much more easily.

@rtfeldman
Copy link

This would be extremely helpful for Chrome development, since Chrome has a hard 5MB cap on localStorage but not on IndexedDB, so as far as I can tell it's not possible to use Lawnchair to store more than 5MB in Chrome until this is merged. (Since currently Lawnchair prefers localStorage to IndexedDB, both of which Chrome supports, but only one of which is capped.)

@kofalt
Copy link

kofalt commented Jun 17, 2012

This change makes sense to me, it'd be nice to see it merged.

@fermuch
Copy link

fermuch commented Oct 28, 2012

+1

@demirag
Copy link

demirag commented Nov 12, 2012

Please merge this into master. I think anybody using Lawnchair either implements this by own or finds workarounds. This is very helpful in many cases.

@rtfeldman
Copy link

@brianleroux Any thoughts on merging this? The diff is only a few lines of code, keeps the API the same, and would be much appreciated by several of us. :)

brianleroux added a commit that referenced this pull request Jan 28, 2013
Specify an array of preferred adapters
@brianleroux brianleroux merged commit 6c8b9bf into brianleroux:master Jan 28, 2013
@rtfeldman
Copy link

Awesome! :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants