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

react-offline-cache

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-offline-cache

A basic cache for React applications. Offline cache to applications. It also serves as a reference for more advanced caching implementations.

  • 0.0.6
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

react-offline-cache

Create a cache to offline connection

A basic cache for React applications. Offline cache to applications. It also serves as a reference for more advanced caching implementations.

Install

npm install react-offline-cache

src/index.js

import React from "react";
import ReactDOM from "react-dom";
import App from "./App";
// react-offline-cache
import * as roc from 'react-offline-cache';

ReactDOM.render(<App />, document.getElementById("root"));

// init faster
roc.register();

How to remove

roc.unregister();

Is online

console.log('online:', roc.isOnline());

Is offline

if(roc.isOffline()) {
  window.alert('Your internet is offline. Sorry.');
}

License

The MIT License.

Author

Natan Cabral
natancabral@hotmail.com
https://github.com/natancabral/

Thank you

Keywords

FAQs

Package last updated on 21 Jan 2022

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