question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Single/scope containers don't auto remove store when unmounted

See original GitHub issue

I checked that react-sweet-state will remove the store when unmounted in case it hasn’t had any subscriber. But it didn’t work in my case. I debugged and found that the deleting happens before subscribers unsubscribed. Did i wrong somewhere or is this the bug?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
albertogasparincommented, Apr 11, 2020

I’ve verified and that is the case indeed. It is properly cleaned up on scope update however on unmount the check is done on componentWillUnmount while the listener removal is done after unmount (due to how useEffect works), as you discovered.

0reactions
nghiaphunguyencommented, Apr 15, 2020

@albertogasparin thank you so much. I upgraded and it works well.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can't perform a React state update on an unmounted ...
This seems like a nice solution if you've already narrowed down the cause/useEffect that is causing the problem, but one of the questions...
Read more >
How to keep your docker installation clean? | by Maciek Opała
Good news is that docker doesn't use system resources besides disk space for non-running containers, images or unmounted volumes.
Read more >
docker volume prune - Docker Documentation
docker volume prune: Remove all unused local volumes. Unused local volumes are those which are not referenced by any containers.
Read more >
Job failed (system failure): Error: No such container ... - GitLab
Summary. It happens on random (for about 10% of the jobs), in 2-5 min into the job. Job simply fails with this error....
Read more >
How To Share Data between Docker Containers on Ubuntu ...
Because you used the --rm flag, your container will be automatically deleted when you exit. Your volume, however, will still be accessible. exit....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found