gregnb / gregnb/mui-datatables

How to update redux-persist data onDelete?

Open
#1,500 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
2.7k
Forks
906
PR merge metrics
No merged PRs in 30d

Description

I create the data for the Table then I save it to Redux Persist Store. It displays correctly in the table. But when II delete the entry in the Table and refresh it, won´t update the Redux Persist Store. How to implement that?

**Table**

```

```
**The Reducer**
```
const data = []
const meetingPushReducer = (state = data, action) => {
console.log(data)
switch (action.type) {
case 'Push':
return [...state, action.newItem]

default:
return state
}
}
```
**Adding the data to the Table**
```
const setItem = function () {
let newItem = [
sessionStorage.getItem('1'),
sessionStorage.getItem('2'),
sessionStorage.getItem('3'),
sessionStorage.getItem('4'),
sessionStorage.getItem('5'),
sessionStorage.getItem('6'),
sessionStorage.getItem('7'),

]
dispatch({ type: 'Push', newItem })
dispatch(increment(1))
}
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Begin with the MUIDataTable usage and the meetingPushReducer shown in the issue, then reproduce the delete and refresh flow to trace where the Redux Persist state stops updating. Done means the deleted table entry remains absent after a refresh and the relevant reducer or persistence behavior is covered by a verified test or reproduction.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.