Major Changes
-
#4049
afc690046
Thanks @davidkpiano! - If context types are specified in the machine config, thecontext
property will now be required:// ❌ TS error createMachine({ types: {} as { context: { count: number }; } // Missing context property }); // ✅ OK createMachine({ types: {} as { context: { count: number }; }, context: { count: 0 } });
Minor Changes
-
#4117
c7c3cb459
Thanks @davidkpiano! - Actor logic creators now have access toself
:const promiseLogic = fromPromise(({ self }) => { ... }); const observableLogic = fromObservable(({ self }) => { ... }); const callbackLogic = fromCallback((sendBack, receive, { self }) => { ... }); const transitionLogic = fromTransition((state, event, { self }) => { ... }, ...);