1.0.1 • Published 4 years ago
react-apollo-idle-cache-eviction v1.0.1
react-apollo-idle-cache-eviction
Hooks for performing cache eviction when the user is detected to be idle.
Install
npm install --save react-apollo-idle-cache-eviction
Usage
import React, { Component } from 'react'
import { useIdleCacheEviction } from 'react-apollo-idle-cache-eviction'
const AppRoot = () => {
useIdleCacheEviction({
checkInterval: 10 * 1000,
minimumIdleMs: 30 * 1000,
onCacheClear: () => console.log("Cleared!")
});
return (
<div>This is a page.</div>
)
}
License
MIT © Senney