I'm using redux in a project and after returning an endpoint, I add a value in state, then I need to use this value that is in the state to send in another request.
The path that is the saved value is this:
form.state.code.code
And I did this:
const getValue = await getState().form.state.code.code ? getState().form.state.code.code : null;
I made this conditional to check if there is any value in the state, if it doesn't exist, it should return null
This code works, but I'm finding it very verbose, is there any way to improve it?