A basic cache for React applications. Offline cache to applications. It also serves as a reference for more advanced caching implementations.
npm install react-offline-cache
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();
roc.unregister();
console.log('online:', roc.isOnline());
if(roc.isOffline()) {
window.alert('Your internet is offline. Sorry.');
}
The MIT License.
![]() |
Natan Cabral natancabral@hotmail.com https://github.com/natancabral/ |