It seems entry actions run after invoke.input gets resolved. Is that the desired behavior or a bug?
createMachine({
context: {
next: 'next',
current: null
},
initial: 'process',
states: {
process: {
entry: [assign(({context}) => {
return {
current: context.next,
next: null,
}
})],
invoke: {
input: ({context}) => context.current,
src: fromPromise(async ({input}) => {
// ❌ expected input to be "next" but it is null.
})
},
},
}
});