mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-03-07 00:30:19 +01:00
adding redux in progress
This commit is contained in:
parent
85efaa4173
commit
7978ddd871
8 changed files with 97 additions and 62 deletions
20
store/messageSlice.js
Normal file
20
store/messageSlice.js
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
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;
|
||||
Loading…
Add table
Add a link
Reference in a new issue