Skip to content
module@warp-drive/core/reactive

Function withDefaults() ​

ts
function withDefaults(schema: WithPartial<PolarisResourceSchema, "identity">): PolarisResourceSchema;

Defined in: warp-drive-packages/core/src/reactive/-private/schema.ts:449

Utility for constructing a ResourceSchema with the recommended fields for the PolarisMode experience.

The ResourceSchemas guide shows how to create a schema with it.

Using this requires registering the PolarisMode derivations

ts
import { registerDerivations } from '@warp-drive/core/reactive';

registerDerivations(schema);

Parameters ​

schema ​

WithPartial<PolarisResourceSchema, "identity">

Returns ​

PolarisResourceSchema

Released under the MIT License.