ForbesLindesay / redux-optimist

Optimistically apply actions that can be later commited or reverted.
MIT License
776 stars 39 forks source link

Simplified commit and revert reducers #3

Open frankleonrose opened 9 years ago

frankleonrose commented 9 years ago

I was trying to understand the new logic and couldn't keep the conditions straight in my head. I simplified them by making a single decision about whether we're dealing with an entry from the transaction of interest. Also, there's only one place where entries get pushed into the newOptimist.

ForbesLindesay commented 9 years ago

I'd prefer to have } else { (i.e. all on one line), but other than that and the two small nits, this looks great. Thanks for taking the time to tidy up my code!