Skip to content
Discussion options

You must be logged in to vote

Hi @NiklasKappel,

In the context of multiple visitors, this demo might be a bit misleading. As you noticed correctly, it is using script mode because there is no page function, so NiceGUI creates one for you. This function wraps all code, including the Demo class definition and the demo instance, which kind of misses the point of such a data model class. The app is still working, but - yes - every visitor gets to see a new demo instance.

Your second snippet results in the same behavior, because there's a new demo instance for every visitor. The only technical difference is that all instances are created from the same Demo class, not like in the first snippet where even the class was creat…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by NiklasKappel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants