1.0.0 • Published 7 years ago
react-native-http-datacache v1.0.0
react-native-http-datacache
用于处理http数据缓存
用法:
import Fetch from 'react-native-http-datacache';
const result = Fetch('http://test');
const cache = result.next(); // 缓存的数据: promise type
const data = result.next(); // api的数据 : promise type
cache.value && cache.value
.then(res => console.log('data from cache: ', res))
data.value && data.value
.then(res => console.log('data from api: ', res))
感激
1.0.0
7 years ago