28 lines
478 B
TypeScript
28 lines
478 B
TypeScript
import { createSlice } from '@reduxjs/toolkit'
|
|
|
|
export interface Challenge {
|
|
id: number
|
|
title: string,
|
|
description: string,
|
|
reward: number,
|
|
}
|
|
|
|
export interface ChallengesState {
|
|
challenges: Challenge[]
|
|
}
|
|
|
|
const initialState: ChallengesState = {
|
|
challenges: []
|
|
}
|
|
|
|
export const challengesSlice = createSlice({
|
|
name: 'challenges',
|
|
initialState: initialState,
|
|
reducers: {
|
|
},
|
|
})
|
|
|
|
export const { } = challengesSlice.actions
|
|
|
|
export default challengesSlice.reducer
|