Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-clear-cache

Package Overview
Dependencies
Maintainers
1
Versions
48
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-clear-cache

A component to manage application updates.

  • 1.0.19
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.7K
decreased by-33.51%
Maintainers
1
Weekly downloads
 
Created
Source

react-clear-cache

A component to manage application updates.

NPM JavaScript Style Guide

Demo

See demo

Install

$ npm install --save react-clear-cache

Add script in package.json

This will generate meta.json file. This will have the version key with the latest build.

{
  "prebuild": "npm run generate-build-meta",
  "generate-build-meta": "./node_modules/react-clear-cache/bin/cli.js"
}

Usage

import * as React from 'react';

import ClearCache from 'react-clear-cache';

const App: React.FC<{}> = () => {
  return (
    <div>
      <ClearCache>
        {({ loading, latestVersion, isLatestVersion, emptyCacheStorage }) =>
          <div>App works!</div>
        }
      </ClearCache>
    </div>
  );
};

export default App;

Props

duration: number

You can set the duration when to fetch for new updates.

Render prop function

loading: boolean

A boolean that indicates whether the request is in flight

latestVersion: string

A string containing the latest version number of the build.

isLatestVersion: boolean

A boolean that indicates if the user has the latest version.

emptyCacheStorage: () => void

This function empty the CacheStorage and reloads the page.

Contributors

  1. noahjohn9259

License

MIT © noahjohn9259

FAQs

Package last updated on 27 Jun 2019

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc