1.0.5 • Published 1 year ago

swr-lru-cache v1.0.5

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

swr-lru-cache

A drop in LRU Cache for SWR

swr-lru-cache is a Least Recently Used (LRU) cache implementation for Vercel's SWR (Stale-While-Revalidate) library. It optimizes memory usage by limiting the number of stored items and evicting the least accessed items when capacity is reached.

Installation

In the root of your application add the following:

import { SWRConfig } from 'swr'
import { SwrLruCache } from 'swr-lru-cache';

// ...

function App() {
// ...

  return (
    <SWRConfig value={{ provider: () => new SwrLruCache(250) }}>
      // ...
    </SWRConfig/>
  );
}
1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago