kernl API
    Preparing search index...

    Function createEventCache

    • Give a backend kernl's cache rules: replaceable and addressable events keep only their newest version, kind 5 deletions by the same author remove their targets and keep them out, ephemeral events are not stored, and writes run one after another so two batches never race on the same address.

      Parameters

      • name: string

        The cache's name.

      • records: EventRecords

        The backend's storage.

      Returns EventCache

      An EventCache over records.

      import { createEventCache, type EventRecords } from '@kernlize/core/cache';

      declare const records: EventRecords;
      const cache = createEventCache('custom', records);
      await cache.query([{ kinds: [0], limit: 1 }]);