Skip to content

Conversation

@dxbr
Copy link

@dxbr dxbr commented Sep 6, 2025

Refactor server-response-adapter for safer async handling and typed event listeners

Summary

This PR refactors the server-response-adapter and improves code clarity, type safety, and maintainability:

  1. Safer Async Handling

    • Removed async promise executors and wrapped asynchronous logic in an IIFE.
    • Eliminates potential unhandled promise rejections during response creation.
  2. Typed Event Listeners

    • Added explicit typing for event listener arguments (unknown[]).
    • Ensures type safety and prevents misuse of listener arguments.
  3. Organized Utility Imports

    • Reorganized imports in lib/utils for clarity and consistency.
    • Improves maintainability and readability.

Testing

Linting & style check

pnpm exec biome check lib/utils.ts lib/server-response-adapter.ts

TypeScript compilation check

npx tsc -p tsconfig.json --noEmit && echo tsc-ok

All checks passed successfully.

Files Changed

  • lib/server-response-adapter.ts
  • lib/utils.ts

@vercel
Copy link

vercel bot commented Sep 6, 2025

@dxbr is attempting to deploy a commit to the Monad Foundation Team on Vercel.

A member of the Team first needs to authorize it.

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.

1 participant