Skip to content
Back to skills

607 Event Handler Pattern 7afdbc24

ASecurity

```typescript type VercelEventType = 'resource.created' | 'resource.updated' | 'resource.deleted';

  • 9 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added October 11, 2026
developmenttypescript

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned October 11, 2026

npx -y skills add tools-only/X-Skills --skill 607-event-handler-pattern_7afdbc24 --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of 607 Event Handler Pattern 7afdbc24?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for 607 Event Handler Pattern 7afdbc24
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/tools-only-607-event-handler-pattern-7afdbc24/badge)](https://www.skillsdirectory.com/skills/tools-only-607-event-handler-pattern-7afdbc24)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
# Event Handler Pattern

## Event Handler Pattern

```typescript
type VercelEventType = 'resource.created' | 'resource.updated' | 'resource.deleted';

interface VercelEvent {
  id: string;
  type: VercelEventType;
  data: Record<string, any>;
  created: string;
}

const eventHandlers: Record<VercelEventType, (data: any) => Promise<void>> = {
  'resource.created': async (data) => { /* handle */ },
  'resource.updated': async (data) => { /* handle */ },
  'resource.deleted': async (data) => { /* handle */ }
};

async function handleVercelEvent(event: VercelEvent): Promise<void> {
  const handler = eventHandlers[event.type];

  if (!handler) {
    console.log(`Unhandled event type: ${event.type}`);
    return;
  }

  try {
    await handler(event.data);
    console.log(`Processed ${event.type}: ${event.id}`);
  } catch (error) {
    console.error(`Failed to process ${event.type}: ${event.id}`, error);
    throw error; // Rethrow to trigger retry
  }
}
```

Files in this skill

  • README.md1.1 KB
  • skill.md966 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.