I want to have a heavy object shared between all connected users. The singleton
does this for me:
@st.experimental_singleton
def get_big_database(url):
...
but additionally Iād like to have this behaviour: if youāre the first user opening the app, i.e. no one has given the database url and therefore get_big_database()
hasnāt been called before, then display a bunch of widgets like text input for entering database URL and a button that is connected to get_big_database()
. Otherwise I want to display something like āDatabase already loaded: {URL}ā.
Is there an easy way to do this? i.e. Iām looking for something like a global_state
instead of session_state