Major Changes
-
#4036
e2440f0b1
Thanks @davidkpiano! - Actor types can now be specified in the.types
property ofcreateMachine
:const fetcher = fromPromise(() => fetchUser()); const machine = createMachine({ types: {} as { actors: { src: 'fetchData'; // src name (inline behaviors ideally inferred) id: 'fetch1' | 'fetch2'; // possible ids (optional) logic: typeof fetcher; }; }, invoke: { src: 'fetchData', // strongly typed id: 'fetch2', // strongly typed onDone: { actions: ({ event }) => { event.output; // strongly typed as { result: string } } }, input: { foo: 'hello' } // strongly typed } });
Minor Changes
-
#4157
31eb5f8a1
Thanks @Valkendorm! - MergesendBack
andreceive
with other properties offromCallback
logic creator.const callbackLogic = fromCallback(({ input, system, self, sendBack, receive }) => { ... });