Repository navigation
xstate@4.30.0
Minor Changes
-
#2965
8b8f719c3Thanks @satyasinha! - All actions are now available in theactionsvariable when importing:import { actions } from 'xstate' -
#2892
02de3d44fThanks @davidkpiano! - Persisted state can now be easily restored to a state compatible with the machine without converting it to aStateinstance first:// Persisting a state someService.subscribe(state => { localStorage.setItem('some-state', JSON.stringify(state)); }); // Restoring a state const stateJson = localStorage.getItem('some-state'); // No need to convert `stateJson` object to a state! const someService = interpret(someMachine).start(stateJson);
Patch Changes
-
#3012
ab431dcb8Thanks @Andarist! - Fixed an issue with a reference to@types/nodebeing inserted into XState's compiled output. This could cause unexpected issues in projects expecting APIs likesetTimeoutto be typed with browser compatibility in mind. -
#3023
642e9f5b8Thanks @Andarist! - Fixed an issue with states created usingmachine.getInitialStatenot being "resolved" in full. This could cause some things, such asaftertransitions, not being executed correctly after starting an interpreter using such state. -
#2982
a39145580Thanks @Andarist! - Marked all phantom properties on theStateMachinetype as deprecated. This deprioritized them in IDEs so they don't popup as first suggestions during property access. -
#2992
22737adf2Thanks @Andarist, @mattpocock! - Fixed an issue withstate.contextbecominganyafterstate.matcheswhen typegen is used. -
#2981
edf60d67bThanks @Andarist! - Moved an internal@ts-ignoreto a JSDoc-style comment to fix consuming projects that do not useskipLibCheck. Regular inline and block comments are not preserved in the TypeScript's emit.