sunnylqm / react-native-storage

local storage wrapper for both react-native and browser. Support size controlling, auto expiring, remote data auto syncing and getting batch data in one query.
MIT License
3.01k stars 268 forks source link

如何设置才能不触发async网络请求, #225

Closed LeeZC closed 5 years ago

LeeZC commented 5 years ago

App里判断如果设置了抓包代理,这个时候我就不触发请求数据的async方法,而只是加载以及缓存的数据,请问有设置不触发async网络请求的开关吗,

sunnylqm commented 5 years ago

比如可以这样咯

sync: 是否设置了代理 ? {} : syncModules
LeeZC commented 5 years ago

比如可以这样咯

sync: 是否设置了代理 ? {} : syncModules

我的意思是能不能在调用global.storage.load 的时候,有一个bool参数设定是否触发async方法,

sunnylqm commented 5 years ago

你也可以在sync方法里去判断啊

LeeZC commented 5 years ago

你也可以在sync方法里去判断啊

只能这么做了。。。