Make type "InvokeCallback" public or offer an event type for "sendBack" #5053
Unanswered
phcoliveira
asked this question in
Ideas
Replies: 1 comment
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The title may be confusing, but the issue is rather simple.
Previously, the type
InvokeCallback
was exported by XState. It wasn't public per se, as I guess it was never meant to be used by consumers of the XState library.Using XState version 5.15, I could import such type and wrap the function
fromCallback
with a proper typing for itssendBack
function. I used to wrap it in a function namedenhancedFromCallback
. You can see a discussion about it here: #4666 (comment)With version 5.17, that is no longer possible. And I find very strange that a similar provision is now offered for
({ emit })
, but not for({ sendBack })
, which is arguably much more useful.So, I believe there must be a reason for not offering the means for typing
sendBack
out of the box, I just don't know what this reason might be. In any case, can we at least theInvokeCallback
publicly available so I can continue my approach of using anenhancedFromCallback
?Beta Was this translation helpful? Give feedback.
All reactions