mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-22 03:10:15 +01:00
21 lines
410 B
JavaScript
21 lines
410 B
JavaScript
|
|
import { createSlice } from '@reduxjs/toolkit';
|
||
|
|
|
||
|
|
const initialState = [];
|
||
|
|
|
||
|
|
const currentSlice = createSlice({
|
||
|
|
name: 'messages',
|
||
|
|
initialState,
|
||
|
|
reducers: {
|
||
|
|
setMessages: (state, action) => {
|
||
|
|
console.log('in setMessages reducer');
|
||
|
|
const { payload } = action;
|
||
|
|
state = payload;
|
||
|
|
},
|
||
|
|
}
|
||
|
|
});
|
||
|
|
//
|
||
|
|
|
||
|
|
export const { setMessages } = currentSlice.actions;
|
||
|
|
|
||
|
|
export default currentSlice.reducer;
|