Skip to content

Commit

Permalink
(hotfix): actually make localStorage the default
Browse files Browse the repository at this point in the history
- I thought I made this edit before but I guess I forgot to add it in
  - maybe I looked at https://github.com/pinqy520/mobx-persist/blob/a0bb0ea26142c498665dc65a096acab46c21847f/src/index.ts#L41
    and thought the code was okay -- but it's also set to the default
    arg a few lines up
  • Loading branch information
agilgur5 committed May 22, 2019
1 parent 061ec8d commit 48c9556
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion persist.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import * as LocalStorage from './localStorageAdaptor.js'
export const persist = (name, store, options = {}) => {
let {storage, jsonify, whitelist, blacklist} = options

if (typeof window.localStorage !== 'undefined' && window.localStorage === storage) {
if (typeof window.localStorage !== 'undefined' && (!storage || storage === window.localStorage)) {
storage = LocalStorage
}
if (!jsonify) { jsonify = true } // default to true like mobx-persist
Expand Down

0 comments on commit 48c9556

Please sign in to comment.