st.singleton(func: Optional[function] = None, show_spinner: bool = True, suppress_st_warning=False)
The function that creates the singleton. Streamlit hashes the function's source code.
Enable the spinner. Default is True to show a spinner when there is a "cache miss" and the singleton is being created.
Suppress warnings about calling Streamlit functions from within the singleton function.
Still have questions?
Our forums are full of helpful information and Streamlit experts.