Function sendTo

  • Action creator to send an event to a persistent actor.

    Type Parameters

    • TContext = Record<string, unknown>

    • TEvent = {
          type: string;
      } & Record<string, unknown>

    Parameters

    • actor: string | PersistentActorRef | ((ctx, event) => string | PersistentActorRef)

      The name of the actor to send the event to, or a PersistentActorRef, or a function that takes the current context and event and returns a string or PersistentActorRef

    • event: any

      The event to send or a function that takes the current context and event and returns an event

    • Optional opts: {
          delay: string | number | ((ctx, event) => string | number);
          id: string | number;
      }

      Send options including delay and event ID (which can be used to cancel the event)

      • delay: string | number | ((ctx, event) => string | number)
      • id: string | number

    Returns {
        delay: string | number | ((ctx, event) => string | number);
        event: any;
        id: string | number;
        to: string | PersistentActorRef | ((ctx, event) => string | PersistentActorRef);
        type: string;
    }

    Action object to be used in an xstate definition

    • delay: string | number | ((ctx, event) => string | number)
    • event: any
    • id: string | number
    • to: string | PersistentActorRef | ((ctx, event) => string | PersistentActorRef)
    • type: string

Generated using TypeDoc