Всем привет. Кто redux toolkit юзает подскажите что не так делаю
const counterSlice = createSlice({
name: 'posts',
initialState: initialState,
reducers: {},
extraReducers: {
[fetchPosts.pending]: (state) => (state.loading = true),
[fetchPosts.fulfilled]: (state, actions) => {
state.posts = [...actions.payload];
state.loading = false;
},
[fetchPosts.rejected]: () => console.log('Error'),
},
});