-
-
Notifications
You must be signed in to change notification settings - Fork 12
Callback services not typed correctly #89
Comments
@mattpocock Just checking, is this library still being maintained? I’ve noticed there hasn’t been a new commit/release in a while. |
Hey @bahalperin, it's kind of in experiment status at the moment. We're trying out some new parsers in other projects and, while I'm still full-time at Yozobi I don't have that much time to put to it. However, I'll be joining Stately full-time Monday after next so I'll have more time to put to this. Apologies for the delay in merging your PR. |
@mattpocock Thanks for the quick response! No worries at all, just wanted to make sure these weren't going to sit around forever. And thanks for making this library by the way, it is super super useful! Makes working with xstate in typescript so much more enjoyable 🙌 |
fwiw: import {createMachine} from '@xstate/compiled'
interface Context {}
type Event = {type: 'DUMMY_TYPE'};
const machine = createMachine<Context, Event, 'uid'>({
initial: 'test',
states: {
test: {
invoke: {
id: 'test',
src: () => () => {}
}
}
}
})
Edit: This was running the version from #78 |
The definitions for
InvokeCallback
andInvokeCreator
are currently:xstate-codegen
narrows the event type down to the event that caused the transition and invoked the service. This makes the event type for theSender
in theInvokeCallback
the same. It should be able to send any of the machine's events back to it, regardless of what event caused the service to be invoked.The text was updated successfully, but these errors were encountered: