Hooks for performing cache eviction when the user is detected to be idle.
npm install --save react-apollo-idle-cache-eviction
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>
)
}
MIT © Senney