import { createSlice , PayloadAction } from "@reduxjs/toolkit" ; export interface User { username : string ; } export interface CoreState { user : User | null ; } const initialState = { user : null } ; const core = createSlice ( { name : "core" , initialState , reducers : { setUser ( state , action ) { state . user = action . payload ; } , } , } ) ; export default core ;