Minor Changes
-
#4832
148d8fcef
Thanks @cevr! -fromPromise
now passes a signal into its creator function.const logic = fromPromise(({ signal }) => fetch('https://api.example.com', { signal }) );
This will be called whenever the state transitions before the promise is resolved. This is useful for cancelling the promise if the state changes.
Patch Changes
-
#4876
3f6a73b56
Thanks @davidkpiano! - XState will now warn when calling built-in actions likeassign
,sendTo
,raise
,emit
, etc. directly inside of a custom action. See https://stately.ai/docs/actions#built-in-actions for more details.const machine = createMachine({ entry: () => { // Will warn: // "Custom actions should not call \`assign()\` directly, as it is not imperative. See https://stately.ai/docs/actions#built-in-actions for more details." assign({ // ... }); } });