How can I update the array value?

i’m using react-native with redux-saga
I don’t want to store multiple data in an imagepaths array every time action.data comes in.

Instead, I want to have only one value of action.data in imagepaths, and update action.data in imagepaths whenever action.data is in, and store only one new data.

this is my code how can i fix?

       case UPLOAD_IMAGES_SUCCESS: {
            draft.imagePaths = draft.imagePaths.concat(action.data);
       
            break;
          }

Source: Ask Javascript Questions

LEAVE A COMMENT