User State in zero-true
Our user state is a dictionary that you can instantiate in your notebook by just typing zt.state(). Variables in the state in zero-true allow you to reproduce some of the default behavior that you would get with an IPython notebook. Each user that connects to your notebook in “app” mode gets their own instance of this. To see more about how it works check out the following example:
Cell 1:
The code above instantiates a list. The code below appends to this list in our user state.
Cell 2:
You can see this behavior in the gif below.
This means you can use zero-true’s state object to create more rich and persistent interactions for the end user. For example, with the following code you can create a cell with a button that increments each time it is clicked.
Cell 1: