#How do I raise from within an invokable without a TS error?

1 messages · Page 1 of 1 (latest)

lost geyser
lost geyser
#

it's also not clear why the event is untyped on that guard

echo shell
lost geyser
#

Thanks so much for the help, David. Is there a way to get event in that guard typed? Or is that something that's coming later with the improved v5 typescript gen?

echo shell
#

However, it's best to assert that event anyway, because this event comes from an external service, and you can't always guarantee that the event is what you expect

#

E.g. if it came from an API call, how can you be certain that the API responded with the exact type?

lost geyser
#

it seems that i'd want to narrow in the guard, and depending on the validity of (target to success and perform some action with the data) or go to a failure target. so ideally i'd only have to narrow in the guard to get the raise, assign, or other actions to pick up on the event, but i don't think that's possible. and i may not be making sense

#

or do the validations in the fetch

#

or is there a way to transition in assign, if the assign encounters an error