New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

react-native-localcache

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-localcache

本地缓存插件,可以在ios端进行查看容量,及清空缓存.

latest
Source
npmnpm
Version
0.0.6
Version published
Maintainers
1
Created
Source

#react-native-localcache

本地缓存插件,可以在ios端进行查看容量,及清空缓存.

install

npm install --save react-native-localcache

NPM

code

import Localcache from 'react-native-localcache';
export default class extends Component {
    constructor() {
        super();
        this.state = {};
    }
    componentDidMount() {
        this.getData();
    }
    async getData() {
            const _all = await Localcache.getSize();
            this.setState({
                all: Math.ceil(_all / 1024 / 1024 * 100) / 100
            });
        }
    render(){
        return(
            <View style={styles.list}>
                <Text style={styles.title}>{this.state.all}</Text>
            </View>
        )
    }

}
const styles = StyleSheet.create({
list: {
backgroundColor: '#fff', marginBottom: 10
},
title: {color: '#666', padding: 10}
});

API

import Localcache from 'react-native-localcache';

Localcache.getSize()

获取所有缓存

Localcache.clear()

清除所有缓存

Localcache.clearHttpCache()

清除http缓存

Localcache.getHttpCacheSize()

获取http缓存

Localcache.clearImageCache()

清除图片缓存

Localcache.getImageCacheSize()

获取图片缓存

version

  • v0.0.1 update
  • v0.0.5 update don't RCT defined

Keywords

reactnative

FAQs

Package last updated on 19 Jun 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts