@maarten-betman I already’ve a cache in place to do all that. Also I think the st.cache is way better than the standard lru_cache in functools (which you use in dash btw) since st.cache can hash arrays/dicts as well. It’s passing each and every UI aka “input” element to the SessionState to preserve state is what makes it a pain (plus this “hack” doesn’t really improve readability either). Peeps have been bringing this issue since 0.56, god know how many gists I’ve had to modify to even get sessionstate working 0.80. And given this issue has been prevalent for some time now— it’s naturally expected that streamlit provides a solution by now. This thread alone has been active since Feb, and you guys are still asking me why I need “callbacks” lmao!
@andfanilo thanks for your prompt response. And besides making a feature–it’d be great if you guys could also push out more tutorials/training for the advanced features (such as cache/SessionState).
@andfanilo My problem since last time has finally been solved through streamlit forms. Much appreciated feature. Thanks for the help
Hey all,
We have some updates regarding state. Session State is now natively supported in Streamlit via the 0.84.0 release!
To use, upgrade to the latest version:
pip install --upgrade streamlit
Here are some helpful links:
- Session State Blog Post
- Session State Topic Guide
- Session State API Reference
- Session State Demo App
- Forum release notes
Looking forward to hearing what you think
@kart2k15 @maarten-betman @SimonBiggs @ddutt @arturadib @mkhorasani @Chuck_Bass @zhaoooyue @MatthiasPilz @bubthegreat @emal @Dan_Becker @Ian_Calvert @ai_bi_ci @harshjp93
Thanks for the heads up, looking forward to testing it.
Wishing you all happy 4th,
Dinesh