Skip to content

refactor: drop dead isReady/isTruthy pass-throughs - #4

Merged
okyrychenko-dev merged 1 commit into
mainfrom
refactor/drop-dead-predicate-wrappers
Aug 22, 2026
Merged

refactor: drop dead isReady/isTruthy pass-throughs#4
okyrychenko-dev merged 1 commit into
mainfrom
refactor/drop-dead-predicate-wrappers

Conversation

@okyrychenko-dev

Copy link
Copy Markdown
Owner

useEffectWhenReady/useEffectWhenTruthy hand-wired isReady/isTruthy, which were one-line forwards to predicates.ready/predicates.truthy with no behavior of their own. Call the predicates directly and delete the wrapper files.

UseEffectWhenPredicates moves from method syntax to property syntax so predicates.ready/truthy can be passed by reference without tripping @typescript-eslint/unbound-method.

Also drops the createEffectWhen JSDoc example that showed baking predicates.ready into a factory-created hook — that pattern silently loses per-call-site tuple narrowing, since createEffectWhen fixes its generic type parameter once at creation time.

useEffectWhenReady/useEffectWhenTruthy hand-wired isReady/isTruthy,
which were one-line forwards to predicates.ready/predicates.truthy
with no behavior of their own. Call the predicates directly and
delete the wrapper files.

UseEffectWhenPredicates moves from method syntax to property syntax
so predicates.ready/truthy can be passed by reference without
tripping @typescript-eslint/unbound-method.

Also drops the createEffectWhen JSDoc example that showed baking
predicates.ready into a factory-created hook — that pattern silently
loses per-call-site tuple narrowing, since createEffectWhen fixes its
generic type parameter once at creation time.
@codecov

codecov Bot commented Aug 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@okyrychenko-dev
okyrychenko-dev merged commit 84b071d into main Aug 22, 2026
3 checks passed
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