Create resource server fetch fn
createResourceServerFetchFn, CreateResourceServerFetchFnConfig, ResourceServerAction: generated from the source of active-grid.
Exported by @workspace/. Generated from the package source; part of the index of every export.
Functions, hooks and constants#
<TRow>(config: CreateResourceServerFetchFnConfig<TRow>) => ServerFetchFunction<TRow>Types#
Build a grid Server on top of a resource data-action. It transmits no authority fields — no model, no permission, no include, no where — only view plus the interaction state (page, filters, sorting, global search, optional scope/preset/groupBy) crosses the wire. The server-defined resource view holds model, permission, select and every where fragment; this is the only server-mode data path.
interface CreateResourceServerFetchFnConfig<TRow> {
serverAction: ResourceServerAction;
viewKey: string;
scope?: unknown | ((params: ServerFetchParams) => unknown);
preset?: string;
transform?: (row: unknown) => TRow;
onError?: (message: string) => void;
capabilities?: GridServerCapabilities;
}A resource data-action (produced by active-' create). It receives the neutral wire-request and returns the neutral result. The action holds model / permission / select / where server-side; the client sends only the view key plus interaction state.
type ResourceServerAction = (
request: unknown,
) => Promise<ResourceActionResult>;