docs: remove limitation on arrow functions in workflows (#7958)
This commit is contained in:
@@ -6,30 +6,6 @@ export const metadata = {
|
|||||||
|
|
||||||
This chapter lists some constraints to keep in mind when defining a workflow's constructor function.
|
This chapter lists some constraints to keep in mind when defining a workflow's constructor function.
|
||||||
|
|
||||||
## No Arrow Functions
|
|
||||||
|
|
||||||
The function passed to the `createWorkflow` function can’t be an arrow function:
|
|
||||||
|
|
||||||
```ts highlights={[["5", "=>", "Function can't be an arrow function"], ["13", "", "Correct way of defining the function."]]}
|
|
||||||
// Don't
|
|
||||||
const myWorkflow = createWorkflow<
|
|
||||||
WorkflowInput,
|
|
||||||
WorkflowOutput
|
|
||||||
>("hello-world", (input) => {
|
|
||||||
// ...
|
|
||||||
})
|
|
||||||
|
|
||||||
// Do
|
|
||||||
const myWorkflow = createWorkflow<
|
|
||||||
WorkflowInput,
|
|
||||||
WorkflowOutput
|
|
||||||
>("hello-world", function (input) {
|
|
||||||
// ...
|
|
||||||
})
|
|
||||||
```
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## No Async Functions
|
## No Async Functions
|
||||||
|
|
||||||
The function passed to the `createWorkflow` can’t be an async function:
|
The function passed to the `createWorkflow` can’t be an async function:
|
||||||
|
|||||||
Reference in New Issue
Block a user