Skip to content

Commit

Permalink
allow webhook handler without promises
Browse files Browse the repository at this point in the history
  • Loading branch information
freisenhauer committed Nov 22, 2024
1 parent b868886 commit 534ce88
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/silly-tools-reflect.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@weissaufschwarz/mitthooks": patch
---

FEATURE: allow webhook handler without promises
4 changes: 2 additions & 2 deletions packages/mitthooks/src/handler/interface.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import type { WebhookContent } from "../webhook.js";

export type HandleWebhook = (webhookContent: WebhookContent) => Promise<void>;
export type HandleWebhook = (webhookContent: WebhookContent) => Promise<void> | void;

export interface WebhookHandler {
handleWebhook: (
webhookContent: WebhookContent,
next: HandleWebhook,
) => Promise<void>;
) => Promise<void> | void;
}

0 comments on commit 534ce88

Please sign in to comment.