Skip to content

Dear diary - insaf#290

Open
ahmedinshaf wants to merge 4 commits intofcodelabs:Insaffrom
ahmedinshaf:insaf
Open

Dear diary - insaf#290
ahmedinshaf wants to merge 4 commits intofcodelabs:Insaffrom
ahmedinshaf:insaf

Conversation

@ahmedinshaf
Copy link

No description provided.

@ahmedinshaf ahmedinshaf marked this pull request as draft September 9, 2023 04:25
@ahmedinshaf ahmedinshaf marked this pull request as ready for review September 9, 2023 04:25
Comment on lines +16 to +26
export default function reducer(state = initialState, action: Action) {
switch (action.type) {
case SET_USER_NAME:
return {
...state,
userName: action.payload,
};
default:
return state;
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is old way of defining reducers. In the redux toolkit, reducers are defined as slices, and the way actions are defined is different. Please go through the documentation of redux toolkit and refactor your code.

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