Skip to content

Replace any types in DotGrid component with proper TypeScript types #65

@aruneshwisdm

Description

@aruneshwisdm

Summary

The DotGrid component in apps/web/components/DotGrid.tsx uses any types in its throttle utility function. These should be replaced with proper TypeScript types.

Current code (lines 8-11)

const throttle = (func: (...args: any[]) => void, limit: number) => {
  let lastCall = 0;
  return function (this: any, ...args: any[]) {
    // ...

What to do

Replace the any types with proper generics or specific types:

const throttle = <T extends (...args: unknown[]) => void>(func: T, limit: number) => {
  let lastCall = 0;
  return function (this: ThisParameterType<T>, ...args: Parameters<T>) {
    // ...

Files

  • apps/web/components/DotGrid.tsx (lines 8-11)

Acceptance criteria

  • All three any usages in the throttle function are replaced with proper types
  • No new eslint-disable comments are added
  • The component still compiles with pnpm build (no TypeScript errors)
  • The throttle behavior is unchanged (the DotGrid animation still works)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions