Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import { createSlice } from '@reduxjs/toolkit';
- export const profileSlice = createSlice({
- name: 'profile',
- initialState: {
- name: 'Default User'
- },
- reducers: {
- setName: (state, action) => {
- state.name = action.payload;
- }
- }
- });
- export const { setName } = profileSlice.actions;
- export const selectName = (state) => state.profile.name;
- export default profileSlice.reducer;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement