Azure / azure-functions-durable-js

JavaScript library for using the Durable Functions bindings
https://www.npmjs.com/package/durable-functions
MIT License
131 stars 47 forks source link

Update OrchestrationHandler type #449

Closed hossam-nasr closed 1 year ago

hossam-nasr commented 1 year ago

Second bullet point in #416 . Updates OrchestrationHandler type from (context: OrchestrationContext) => Generator<unknown, unknown, any> to OrchestrationHandler<T> = (context: OrchestrationContext) => Generator<Task, T, any> (T being the return type of the generator)

hossam-nasr commented 1 year ago

For the sake for getting this to move forward before preview with the most benefit possible, I've updated this so that the only change is adding the Task type as the only allowed yield type, while leaving TReturn as unknown and TNext as any. I've created an issue here though: #488 to track possibly adding the TReturn generic for GA