Skip to content

Refactor/use debounce hook in job browse page#333

Merged
Sachinchaurasiya360 merged 5 commits into
Sachinchaurasiya360:mainfrom
Harkiratcodess:refactor/use-debounce-hook-in-job-browse-page
May 21, 2026
Merged

Refactor/use debounce hook in job browse page#333
Sachinchaurasiya360 merged 5 commits into
Sachinchaurasiya360:mainfrom
Harkiratcodess:refactor/use-debounce-hook-in-job-browse-page

Conversation

@Harkiratcodess
Copy link
Copy Markdown
Contributor

ficx #125

Problem

JobBrowsePage.tsx manually duplicated debounce logic using
useRef + useEffect + setTimeout instead of using the
existing reusable useDebounce hook at client/src/hooks/useDebounce.ts.
This violates DRY and makes the code harder to maintain.

Fix

Replaced manual debounce implementation with two useDebounce calls:

  • const debouncedSearch = useDebounce(search, 400)
  • const debouncedLocation = useDebounce(locationFilter, 400)

Also removed:

  • timerRef (no longer needed)
  • debouncedSearch and debouncedLocation useState declarations
  • submitSearch function (no longer needed)
  • useEffect and useRef imports (no longer used)

Files Changed

  • client/src/module/student/jobs/JobBrowsePage.tsx

Note

The existing useDebounce hook at client/src/hooks/useDebounce.ts
was already being used in other parts of the codebase. This PR
brings JobBrowsePage in line with that pattern.

Label Request

Requesting refactor label for this PR.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 19, 2026

Warning

Rate limit exceeded

@Harkiratcodess has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 15 minutes and 25 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ef8c975d-46a7-4a73-b514-309f1cdfd525

📥 Commits

Reviewing files that changed from the base of the PR and between 3552efa and 1b0e24a.

📒 Files selected for processing (3)
  • client/src/components/Navbar.tsx
  • client/src/module/student/companies/CompanyListPage.tsx
  • client/src/module/student/jobs/JobBrowsePage.tsx
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Sachinchaurasiya360 Sachinchaurasiya360 added good first issue Good for newcomers level:beginner Good for first-time contributors type:performance Performance optimization changes gssoc:approved Approved for GSSoC scoring labels May 21, 2026
@Sachinchaurasiya360 Sachinchaurasiya360 merged commit 84379b9 into Sachinchaurasiya360:main May 21, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

good first issue Good for newcomers gssoc:approved Approved for GSSoC scoring level:beginner Good for first-time contributors type:performance Performance optimization changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants