← @mortar-kit/core

ContentClientOptionsinterface

import { ContentClientOptions } from '@mortar-kit/core'

interface ContentClientOptions

Options for contentClient. Pass the router's and server functions' helpers; Mortar depends on neither.

Properties

read?: (fn: (args: never[]) => Promise<unknown>) => unknown

Declares a read as a GET (GET from @solidjs/web/server-functions), so reads aren't mutations that revalidate everything.

cache?: (fn: (args: never[]) => Promise<unknown>, key: string) => unknown

Caches a read per request and across hydration (query from @solidjs/router).

onWrite?: () => void

Runs after each successful write, to drop cached reads (() => query.clear()).