Repository navigation
xstate@4.25.0
·
3574 commits
to next
since this release
Minor Changes
-
#2657
72155c1b7Thanks @mattpocock! - Removed the ability to pass a model as a generic tocreateMachine, in favour ofmodel.createMachine. This lets us cut an overload from the definition ofcreateMachine, meaning errors become more targeted and less cryptic.This means that this approach is no longer supported:
const model = createModel({}); const machine = createMachine<typeof model>();
If you're using this approach, you should use
model.createMachineinstead:const model = createModel({}); const machine = model.createMachine();
Patch Changes
-
#2659
7bfeb930dThanks @Andarist! - Fixed a regression in the inline actions type inference in models without explicit action creators.const model = createModel( { foo: 100 }, { events: { BAR: () => ({}) } } ); model.createMachine({ // `ctx` was of type `any` entry: ctx => {}, exit: assign({ // `ctx` was of type `unknown` foo: ctx => 42 }) });