I will walk you through the process of building a component that's used to create records and also edit records from the list of available records using the minimum code possible.
There might be umpteen number of ways to implement it, but I choose this approach only to make sure that I build it with minimum no of lines of code.
Let's get started!
Here comes the controller.js file
This is the helper/util class
Here is the Apex Class
Feel free to let me know in case you know any other approach that’s even more simple than this.
You can also do it using standard out of the box events which are namely e.force:editRecord and e.force:recordSave but refreshing the list after updating/creating nay record remains a challenge. Hence I opted for this approach.