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

Is there a way to pause/stop withObservables() #1457

Open
Stophface opened this issue Dec 29, 2022 · 3 comments
Open

Is there a way to pause/stop withObservables() #1457

Stophface opened this issue Dec 29, 2022 · 3 comments

Comments

@Stophface
Copy link

Is there a way to pause/stop withObservable()?
Why? When working with react-navigation, the screen does not get unmounted, which means the withObservable() keeps on running, even if the screen is not focussed anymore. Assuming there are five or six screens connected to a rather large table, this would result in performance issue because all the screens would continiously read from the database (if there are changes), eventhough the screen is not in focus.

@Stophface Stophface changed the title pause withObservables() Is there a way to pause/stop withObservables() Dec 29, 2022
@ChrisSimoniMBT
Copy link

ChrisSimoniMBT commented Jan 5, 2023

Use withObserve in child components of the screen. When blurring the screen replace those components with placeholders. Restore on focus.

Edit: as temp solution like i use

@Stophface
Copy link
Author

@ChrisSimoniMBT thanks. That sounds like a reasonable workaround. Do you know if the withObservables() also run, when the app went to the background?

@rohankm
Copy link

rohankm commented Feb 9, 2024

is there any permanent solution for this?

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

3 participants