github-actions
released this
21 Mar 03:56
·
3381 commits
to main
since this release
Minor Changes
-
9f6a6e9e
#1991 Thanks @santicros! - Added newuseActor
, which is a composable that subscribes to emitted changes from an existingactor
:import { useActor } from '@xstate/vue'; export default defineComponent({ props: ['someSpawnedActor'], setup(props) { const { state, send } = useActor(props.someSpawnedActor); return { state, send }; } });
-
bfe42972
#1991 Thanks @santicros! - Fixed the UMD build by externalizing XState & Vue correctly. -
4346cabc
#1991 Thanks @santicros! - Added newuseInterpret
, which is a low-level composable that interprets themachine
and returns theservice
:import { useInterpret } from '@xstate/vue'; import { someMachine } from '../path/to/someMachine'; export default defineComponent({ setup() { const state = ref(); const service = useInterpret(machine, {}, nextState => { state.value = nextState.value; }); return { service, state }; } });
-
012ef363
#1991 Thanks @santicros! - Added a proper ESM file using the"module"
field in thepackage.json
. It helps bundlers to automatically pick this over a file authored using CommonJS and allows them to apply some optimizations easier.