Skip to content

Commit

Permalink
(refactor): change ordering of jsonify to match README
Browse files Browse the repository at this point in the history
- it really should've been second to begin with, but I destructured it
  out once I was already done and didn't think about / realize that
  • Loading branch information
agilgur5 committed May 19, 2019
1 parent 9a081bb commit f38e6e4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions persist.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ import { onSnapshot, applySnapshot } from 'mobx-state-tree'
import * as LocalStorage from './localStorageAdaptor.js'

export const persist = (name, store, options = {}) => {
let {storage, whitelist, blacklist, jsonify} = options
let {storage, jsonify, whitelist, blacklist} = options

if (typeof window.localStorage !== 'undefined' && window.localStorage === storage) {
storage = LocalStorage
}
if (!jsonify) { jsonify = true } // default to true like mobx-persist
const whitelistDict = arrToDict(whitelist)
const blacklistDict = arrToDict(blacklist)
if (!jsonify) { jsonify = true } // default to true like mobx-persist

onSnapshot(store, (_snapshot) => {
const snapshot = { ..._snapshot }
Expand Down

0 comments on commit f38e6e4

Please sign in to comment.