How can I make an array of Recipe type in Initialvalue, and how to make Payloadaction as a object type? I am a typescript beginner unfortunetly.
import { createSlice, PayloadAction } from "@reduxjs/toolkit";
type Recipe = {
title: string,
}
const INITIAL_VALUE = {
recipes: []
}
const recipeSlice = createSlice({
name: 'recipe',
initialState: INITIAL_VALUE,
reducers: {
addRecipe(state, action: PayloadAction<{}>) {
state.recipes.push(action.payload)
}
}
})