Remix
Remix
remix/data-schema/lazy · FunctionView Source

lazy

Summary

Create a lazily-evaluated schema.

This is useful for recursive schemas without circular module references.

Signature

function lazy<schema extends Schema<any, any>>(
  getSchema: () => schema,
): Schema<InferInput<schema>, InferOutput<schema>>;

Parameters

getSchema

A function that returns the schema when first needed

Returns

A schema that delegates validation to the resolved schema