Closed ichsarut closed 6 years ago
I tried to save object ( 2.56 mb ) but seem like store can not hold that data. it is fine for small one.
loadData = async () => { try { const response = await fetch(URL, { method: 'GET', headers: { Authorization: APIKEY } }); return await response.json(); } catch (e) { console.log(e); } };
await this.setupStorage(); const json = await this.loadData(); console.log('got it', json); try { console.log('saving'); storage.save({ key: 'subdistricts', data: json }); const subdistricts = await storage.load({ key: 'subdistricts' }); console.log('subdist', subdistricts); } catch (e) { console.error(e); }
I suggest something like https://github.com/itinance/react-native-fs to store large data
I tried to save object ( 2.56 mb ) but seem like store can not hold that data. it is fine for small one.