In xstate@v4 I could use:
services: {
fetchSearchResults: (context) => {
getService(context, 'some-service').foo();
}
}
In xstate@v5 I'm trying similar (using the fromPormise):
actors: { // in v5 `services` was renamed to `actors`
fetchSearchResults: fromPromise(async (context) => {
getService(context, 'some-service').foo(); // This will throw
}),
}
But the code will trow with:
Assertion Failed: Expected passed context to be aware of the container (owner)
I tried to manually inspect the provided object to see if I spot Symbol(OWNER): ApplicationInstance, but no luck.
I can, however, pass the entire context down as input and then use that. But that's a biiiit weird. Is there a nicer way to be able to use ember-statechart-component getService() inside fromPromise() callback?
invoke: {
input: ({ context }) => {
return context;
},
}
In
xstate@v4I could use:In
xstate@v5I'm trying similar (using the fromPormise):But the code will trow with:
I tried to manually inspect the provided object to see if I spot
Symbol(OWNER): ApplicationInstance, but no luck.I can, however, pass the entire
contextdown as input and then use that. But that's a biiiit weird. Is there a nicer way to be able to useember-statechart-componentgetService()insidefromPromise()callback?