Skip to content

Instantly share code, notes, and snippets.

@erizet
erizet / test.ts
Last active September 2, 2019 06:39
Xstate typing of DoneInvokeEvent
import { Machine, actions, TransitionConfig, DoneInvokeEvent } from 'xstate';
type MessageStatus = { status: string };
type FetchEvent =
FetchEventWithMessageId
| FetchEventWithMessageStatus;
type FetchEventWithMessageId = { type: 'START', remoteSystem: string, messageId: string };
type FetchEventWithMessageStatus = { type: 'endSuccessful', messageStatus: MessageStatus };