useSpawn.d.ts 486 B

12345678910
  1. import { ActorRef, Behavior, EventObject } from 'xstate';
  2. /**
  3. * React hook that spawns an `ActorRef` with the specified `behavior`.
  4. * The returned `ActorRef` can be used with the `useActor(actorRef)` hook.
  5. *
  6. * @param behavior The actor behavior to spawn
  7. * @returns An ActorRef with the specified `behavior`
  8. */
  9. export declare function useSpawn<TState, TEvent extends EventObject>(behavior: Behavior<TEvent, TState>): ActorRef<TEvent, TState>;
  10. //# sourceMappingURL=useSpawn.d.ts.map