DEV Community

Discussion on: Recoil - Facebook's own State Management Library

Collapse
 
stevetaylor profile image
Steve Taylor

It uses promises, which makes it a non-starter for me. Promises can’t be cancelled, so there’s no way to abort pending API requests when they’re no longer needed.

Collapse
 
shubhamk profile image
Shubham Kamath

Yes. Totally!

But if the application is tiny, this can be handy!

Collapse
 
stevetaylor profile image
Steve Taylor

Recoil looks like it’s made for non-trivial apps. It’s very promising (pun not intended) in many ways. It just needs to be a better fit with respect to async.

It’s a pity Observable isn’t yet standardized.

Thread Thread
 
shubhamk profile image
Shubham Kamath

It's recently launched, so there is plenty of room for improvement. What library you suggest based on Observables?

Thread Thread
 
stevetaylor profile image
Steve Taylor

There’s Redux Observable by Netflix.

I prefer Bacon.js over RxJS because it’s more expressive, less verbose, and uses hot observables instead of cold. I created react-baconjs to use it with React.

You could also use Bacon.js with Redux Observable as there’s some interop with standard(ish) observables.

I’d be interested to see how observables could be used with Recoil.

Thread Thread
 
shubhamk profile image
Shubham Kamath

I will surely try this. Thanks a lot sir!