I am building a survey style app using React + Flux. When a user submits an answer I fire off an action that triggers an ajax request to save the answer in the database (ajax request #1). I then need to do an ajax request to get the next question (ajax request #2).
Request #2 depends on the data that #1 writes to the database. I'd like to avoid returning the next question when creating the answer. Any suggestions on where/how best to trigger #2 so that we can be assured #1 has finished?
Thanks