createBufferedCounterStore
function createBufferedCounterStore(inner, options?): BufferedCounterStore;Defined in: src/counters/buffered.ts:65
Wrap inner with write-behind buffering.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
inner |
CounterStore |
options? |
BufferedCounterStoreOptions |
Returns
Section titled “Returns”Example
Section titled “Example”import { createBufferedCounterStore } from "@xtandard/entitlements/counters/buffered";import { createRedisCounterStore } from "@xtandard/entitlements/counters/redis";
const strict = createRedisCounterStore({ url: process.env.REDIS_URL });const buffered = createBufferedCounterStore(strict, { flushInterval: "2s" });