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

Queue messages #4

Merged
merged 3 commits into from
Jul 8, 2024
Merged

Queue messages #4

merged 3 commits into from
Jul 8, 2024

Conversation

johnarban
Copy link
Contributor

So this implements a queue allowing certain messages to be stored until the app is loaded. This works pretty well for foreground/background, but for tables is not very stable. Tables need the app to be fully ready. They seem to need an additional bit of time after the app is mounted in order to stably load and be interacted with. Adding 0.1 sec before loading tables seems to fix this.

This adds a onMounted() callback to the vue app, and a mounted traitlet which is synced to the front-end (.tag(sync=True)). This is more reliable than attempting to pass a message from the the front-end to the backend. There are two ways to add functions to run when mounted. on_ready(callback) and ensure_mounted(callback). on_ready adds what is passed to a list of callbacks which get run in order when mounted. ensure_mounted either runs the callback immediately if the app is mounted, or it will add it to the on_ready stack. The app will run stored messasges, then the callbacks when mounted.

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