Hi,
I’m trying to create a new Jupyterlab extension and I’m using ReactWidget to add a launcher. I’ve been trying to use IStateDB in my ReactWidget so I can retain state, but I cannot seem to figure out how. Is there any guidance on how to do this?
Thanks in advance for your help!
I do not understand which part you are struggling with, the concept of StateDB and ReactWidget are pretty orthogonal and there should not be any bad interaction - what exactly are you trying to achieve/can you provide a code sample for what you tried?
As a data point, jupyterlab-launchpad extension used to use IStateDB
but currently uses a custom server-side JSON file because it allows to persist state even when users switch workspaces.
Hi,
Thanks for the quick reply. Looks like the IStateDB is just using localStorage underneath so I think I’ll probably use that directly instead.
Also, thanks for pointing out the jupyterlab-launchpad extension use case - that’s helpful.
Thanks!
Looks like the IStateDB is just using localStorage underneath
The fallback implementation does use localStorage, but the default one is linked to workspace data which is persisted on the server in JSON files.
Ah ok that’s good to know. Thanks for clarifying!