Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What happens if the component unmounts before promise resolution? #14

Closed
chmac opened this issue Nov 27, 2017 · 3 comments
Closed

What happens if the component unmounts before promise resolution? #14

chmac opened this issue Nov 27, 2017 · 3 comments

Comments

@chmac
Copy link

chmac commented Nov 27, 2017

I imagine that if the component is unmounted before the promise has resolved, then there will be a warning about calling setState() on a component which does not exist.

I haven't tested, so please disregard this issue if it's not the case. I read about the problem somewhere and was looking at the code here to see if this package addresses the issue.

@capaj
Copy link
Owner

capaj commented Dec 4, 2017

@chmac you have a point. I haven't tested it, but this will indeed cause issues. I've made a small PR, can you tell me if it works for you? #15

@chmac
Copy link
Author

chmac commented Dec 5, 2017

Looks like it will do the job. 👍

I ended up building something myself with lifecycle() from recompose using the same approach. I've also since thrown that all away due to performance issues with PouchDB, so can't easily test this unfortunately.

@chmac chmac closed this as completed Dec 5, 2017
@capaj
Copy link
Owner

capaj commented Jan 19, 2018

fix released as 2.0.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants