Skip to content

Remove unnecessary createSelector#4073

Merged
cbeer merged 1 commit intomainfrom
return-own-input
Jan 8, 2025
Merged

Remove unnecessary createSelector#4073
cbeer merged 1 commit intomainfrom
return-own-input

Conversation

@marlo-longley
Copy link
Member

@marlo-longley marlo-longley commented Jan 7, 2025

Fixes warning

The result function returned its own inputs without modification. e.g createSelector([state => state.todos], todos => todos) This could lead to inefficient memoization and unnecessary re-renders. Ensure transformation logic is in the result function, and extraction logic is in the input selectors.

The function was just returning itself.

@marlo-longley marlo-longley marked this pull request as ready for review January 7, 2025 22:02
@codecov
Copy link

codecov bot commented Jan 7, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.52%. Comparing base (1c79e24) to head (c02bf4e).
Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4073      +/-   ##
==========================================
- Coverage   94.52%   94.52%   -0.01%     
==========================================
  Files         313      313              
  Lines       14769    14763       -6     
  Branches     2495     2495              
==========================================
- Hits        13960    13954       -6     
  Misses        804      804              
  Partials        5        5              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@cbeer cbeer merged commit e5470d6 into main Jan 8, 2025
8 checks passed
@cbeer cbeer deleted the return-own-input branch January 8, 2025 15:48
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.

2 participants