Added an attempt to combine the best of the sync and async versions
Removed whitespace
adding react js test example