From the course: Create a CRM Mobile Application with React Native

Unlock the full course today

Join today to access over 24,800 courses taught by industry experts.

Update person Redux reducer

Update person Redux reducer

- [Instructor] In this video, we're going to add all the code that we need for Redux for the update person component. So what we're going to need to do first is go inside of the actions here and then we're going to add a few actions based on what we need for updating a person. So what I'm going to do is first go below the create new contact right here and go ahead and create the action, update, contact. So what we're going to pass is a person, and then what we're going to do is return this action, which is going to be called update contact like so, and the payload is going to be the person. Perfect, now we also need to create an action for saving the contact. So basically whenever we update a contact, we need to save it as well. So what we're going to pass in here is going to be similar to what we're passing when we're creating a new contact. So let's go ahead and copy some of the code that we have right here. So first thing I'm going to copy is all this here and bring it down here…

Contents