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

Expose hideLoadingScreen and hideLoadingScreenNow #158

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

f0rr0
Copy link

@f0rr0 f0rr0 commented Mar 24, 2021

Expose hideLoadingScreen and hideLoadingScreenNow to consumers.

Since showLoading mutates DOM, consumers can call these methods to clean up side-effects or bail early from an 8thWall session. For instance if I am inside a SPA and the user decides to exit the 8thwall route before the loading has finished, I would call these methods to cleanup the loading DOM mutations.

@jparismorgan
Copy link
Contributor

jparismorgan commented Sep 23, 2021

Hi @f0rr0, thanks the suggestion! The R17.1 engine release added a new lifecycle event, onRemove, which is called when a pipeline module is removed. Along with that we updated loading-module.js to call hideLoadingScreenNow() in onRemove. This should lead to the loading module cleaning itself up when you exit an 8th Wall experience, which is something it didn't do well before.

Does this solve your issue? With it you shouldn't need to call hideLoadingScreen or hideLoadingScreenNow yourself, instead the pipeline module should clean itself up. If not I'd love to learn more about what's missing for your scenario. Thanks!

https://github.com/8thwall/web/pull/184/files#diff-f408e456fa730f212ad9756d053d59f2e4b9dfc9f5630dd42e7af6ac4dc84081R450

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

Successfully merging this pull request may close these issues.

2 participants