Type alias AllowWrite<Context, AuthContext, EventShape, StateShape>

AllowWrite<Context, AuthContext, EventShape, StateShape>: ((writeRequest) => boolean)

Type Parameters

Type declaration

    • (writeRequest): boolean
    • allowWrite will be called for every request to send an event to an instance of the machine you are exposing.

      If allowWrite returns true, the request will be permitted. Otherwise, the request will be rejected with a 403 status and { code: "denied-by-machine-definition" }.

      allowWrite must be exported from your machine definition file.

      Use AllowRead<Context, AuthContext, EventShape, StateShape> to specify the shape of your machine's state, events and context and the expected shape of the authContext you will provide.

      Parameters

      • writeRequest: WriteRequest<Context, AuthContext, EventShape, StateShape>

      Returns boolean

Generated using TypeDoc