Skip to main content

Provider components

<CoordinationProvider/>

Required props

spec

  • Type: object

children

  • Type: JSX

Optional props

onSpecChange

  • Type: function

A callback function for spec updates.

validateOnSpecChange

  • Type: boolean

Whether to validate using the validater function when publishing changes. Use for debugging purposes only, as this has a performance impact.

validater

  • Type: function

Validation function to run when validateOnSpecChange is true.

initializer

  • Type: function

Initialization function to run during the creation of the Zustand store.

onCreateStore

  • Type: function

A function to enable access to the Zustand store on its creation. This return value will be passed to the Zustand store creation function. The function will be passed the set parameter from create.

<ZodCoordinationProvider/>

Inherits all props except validater from CoordinationProvider.

Required props

coordinationTypes

  • Type: Record<string, z.ZodTypeAny>

Mapping from coordination type names to Zod schemas.

Optional props

validateSpec

  • Type: boolean

Should the spec be validated against the Zod schema?

<ZodErrorBoundary/>

Wrap <ZodCoordinationProvider/> in this error boundary to catch validation errors. Alternatively, implement your own ErrorBoundary.