greenelab / adage-frontend

The Adage web app, a tool to explore gene expression data and discover new insights from machine learning models
https://adage.greenelab.com
BSD 3-Clause "New" or "Revised" License
4 stars 3 forks source link

look into async function cancelling #56

Closed vincerubinetti closed 4 years ago

vincerubinetti commented 4 years ago

Right now I'm using the "generator-runner" pattern described in this article, but after some discussions with people on github and stackoverflow, it seems this approach is not ideal.

My next PR will get rid of the generator pattern and simplify the code. New actions will still override old ones, but the fetching and all the other async stuff will still be carried out to completion each time.

I want to get either the CAF or posterus integrated into the project to handle "true" cancelation, and simpler. At present, CAF doesn't seem to work with create-react-app, so I'm working with the the author to fix that.

vincerubinetti commented 4 years ago

CAF now works with create-react-app, but implementing it at this point is probably an anti-pattern. Going forward, I'll strongly consider it when building new apps, along with other solutions like redux-saga.