Skip to content

feat: workflow types support generic params#3167

Merged
sidharthachatterjee merged 1 commit intocloudflare:mainfrom
dh94:workflow-types-support-generic-params
Nov 29, 2024
Merged

feat: workflow types support generic params#3167
sidharthachatterjee merged 1 commit intocloudflare:mainfrom
dh94:workflow-types-support-generic-params

Conversation

@dh94
Copy link
Contributor

@dh94 dh94 commented Nov 25, 2024

Improves types usability, instead of writing

type Env {
   MY_WORKFLOW: Workflow;
}

// ... some logic in other file
env.MY_WORKFLOW.create({
  params: {
     some_param: 1
   } as MyWorkflowParams
 });

We could do something like

type Env {
   MY_WORKFLOW: Workflow<MyWorkflowParams>;
}

// ... some logic in other file
env.MY_WORKFLOW.create({
  params: {
     some_param: 1
   }
});

@dh94 dh94 requested review from a team as code owners November 25, 2024 15:13
@dh94 dh94 requested review from anonrig and mar-cf November 25, 2024 15:13
@github-actions
Copy link

github-actions bot commented Nov 25, 2024

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@dh94
Copy link
Contributor Author

dh94 commented Nov 25, 2024

I have read the CLA Document and I hereby sign the CLA

github-actions bot added a commit that referenced this pull request Nov 25, 2024
@dh94
Copy link
Contributor Author

dh94 commented Nov 26, 2024

not sure what to do with the failed CI check, seems unrelated 😅

@sidharthachatterjee
Copy link
Contributor

Thanks @dh94

Yeah, that's unrelated. Merging in. Thanks!

@sidharthachatterjee sidharthachatterjee merged commit 410b59c into cloudflare:main Nov 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants