Skip to content

createBufferedCounterStore

function createBufferedCounterStore(inner, options?): BufferedCounterStore;

Defined in: src/counters/buffered.ts:65

Wrap inner with write-behind buffering.

Parameter Type
inner CounterStore
options? BufferedCounterStoreOptions

BufferedCounterStore

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" });