Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix redux typescript #715

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open

Fix redux typescript #715

wants to merge 4 commits into from

Conversation

alefalezza
Copy link
Collaborator

Just fixed some warnings I got starting application locally with mocks.

@mwithi mwithi requested a review from SilverD3 January 31, 2025 10:53
Copy link
Contributor

@SilverD3 SilverD3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the plus when you create a selector before using it? I mean, what issue are you fixing? Why not to do the same every time we getting a state slice?

Comment on lines +14 to +22
const appSelector = createSelector(
(state) => state.main.authentication.data,
(userCredentials) => ({ userCredentials })
);

const Dashboard = () => {
const { t } = useTranslation();

const { userCredentials } = useAppSelector((state) => ({
userCredentials: state.main.authentication.data,
}));
const { userCredentials } = useAppSelector(appSelector);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alefalezza what is wrong with the actual implementation?

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