Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Reactjs promises, how should we use it?

I've been reading a lot about React for the last 3 days, but I don't see much information about the use of promises, so I have that concern.

Is there any library for this?

How should I use promises in React?

like image 839
Non Avatar asked Aug 05 '15 18:08

Non


1 Answers

React doesn't come with a promise library baked in like Angular with $http. You will have to find your own.

A few you can try:

  • Bluebird (personal recommendation)
  • jQuery's $ajax
  • Native promises (unless you actually have to support IE): http://caniuse.com/#feat=promises
like image 108
sma Avatar answered Oct 17 '22 00:10

sma