import { createSlice } from '@reduxjs/toolkit' ; import { TeamsSettings } from '../../../teams/types' ; import localStorageService from '../../../core/services/local-storage.service' ; interface TeamState { team ? : TeamsSettings | null ; } const initialState = { team : undefined , } ; export const teamSlice = createSlice ( { name : 'team' , initialState , reducers : { initialize : ( state ) => { state . team = localStorageService . getTeams ( ) ; } , resetState : ( state ) => { Object . assign ( state , initialState ) ; } , } , } ) ; export const { initialize } = teamSlice . actions ; export const teamActions = teamSlice . actions ; export default teamSlice . reducer ;