Skip to content

fix(core): apply named function pattern to useEffect calls#347

Open
eunwoo-levi wants to merge 5 commits intotoss:mainfrom
eunwoo-levi:fix/useeffect-named-function-pattern
Open

fix(core): apply named function pattern to useEffect calls#347
eunwoo-levi wants to merge 5 commits intotoss:mainfrom
eunwoo-levi:fix/useeffect-named-function-pattern

Conversation

@eunwoo-levi
Copy link

@eunwoo-levi eunwoo-levi commented Mar 12, 2026

Overview

Apply the named function pattern to useEffect callbacks across multiple hooks to comply with the project's coding standards.

Summary

CLAUDE.md explicitly requires named functions in useEffect:

Named functions in useEffect — Improves stack traces and readability

useEffect(function handleResize() { ... }, []);  // ✅
useEffect(() => { ... }, []);                     // ❌

Changes

  • usePreservedCallback — function syncCallbackRef()
  • useInterval — function runImmediateCallback(), function startInterval()
  • useDebounce — function cancelDebouncedOnUnmount()
  • useDebouncedCallback — function clearDebouncedOnUnmount()
  • useLoading — function trackMountedState()

Checklist

  • Did you write the test code?
  • Have you run yarn run fix to format and lint the code and docs?
  • Have you run yarn run test:coverage to make sure there is no uncovered line?
  • Did you write the JSDoc?

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