Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf38e6e4

Browse files
committed
(refactor): change ordering ofjsonify to match README
- 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
1 parent9a081bb commitf38e6e4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

‎persist.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ import { onSnapshot, applySnapshot } from 'mobx-state-tree'
33
import*asLocalStoragefrom'./localStorageAdaptor.js'
44

55
exportconstpersist=(name,store,options={})=>{
6-
let{storage,whitelist, blacklist, jsonify}=options
6+
let{storage,jsonify, whitelist, blacklist}=options
77

88
if(typeofwindow.localStorage!=='undefined'&&window.localStorage===storage){
99
storage=LocalStorage
1010
}
11+
if(!jsonify){jsonify=true}// default to true like mobx-persist
1112
constwhitelistDict=arrToDict(whitelist)
1213
constblacklistDict=arrToDict(blacklist)
13-
if(!jsonify){jsonify=true}// default to true like mobx-persist
1414

1515
onSnapshot(store,(_snapshot)=>{
1616
constsnapshot={ ..._snapshot}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp