mirror of
https://github.com/morbalint/kemkas.git
synced 2026-07-18 03:13:46 +00:00
use Redux for tulajdonsagok
This commit is contained in:
@@ -6,19 +6,22 @@ export const userSlice = createSlice({
|
||||
name: 'user',
|
||||
initialState: {
|
||||
state: "not-started" as LoadingState,
|
||||
email: null,
|
||||
email: null as string | null,
|
||||
},
|
||||
reducers: {
|
||||
load: (state) => {
|
||||
state.state = "loading"
|
||||
return state
|
||||
},
|
||||
setUser: (state, action) => {
|
||||
setUser: (state, action: {payload: string}) => {
|
||||
state.state = "finished"
|
||||
state.email = action.payload
|
||||
return state
|
||||
},
|
||||
unsetUser: (state) => {
|
||||
state.state = "finished"
|
||||
state.email = null
|
||||
return state
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user