Class PersistSpec
The listed topics are saved per browser under the namespace, 500 ms after the last change. On load the first of
these that yields a value wins: an app link decoder, then a #s= share link (with shareLink()), then
the saved state when its version matches, then each owner's default. Bump version(int) whenever a payload
shape changes; saved state of another version is deleted.
Example:
PersistSpec.
- Since:
- 10.0.0
-
Method Summary
Modifier and TypeMethodDescriptionAppends an app link decoder, registered in JS withJuneauDashboard.decoder.register(name, fn).static PersistSpecCreates a per-page persistence spec.Enables#s=share links and the "Copy link" button.Appends the topics to save and restore.version(int value) Sets the state version.
-
Method Details
-
page
Creates a per-page persistence spec.- Parameters:
ns- The storage namespace, matching^[a-z][a-z0-9.-]{0,63}$.- Returns:
- A new spec.
-
version
Sets the state version.- Parameters:
value- The version, at least 1. Defaults to 1.- Returns:
- This object.
-
topics
Appends the topics to save and restore.- Parameters:
values-filter:,zoom:orlegend:topics owned by members of the dashboard.- Returns:
- This object.
-
decoder
Appends an app link decoder, registered in JS withJuneauDashboard.decoder.register(name, fn).The decoder must be registered before
juneau-charts.jsloads (from thewindow.JuneauConsoleDashboardpre-load queue in a head script, or from a toolkit pack), because restore runs when the first chart mounts. A pageinitscript is too late.- Parameters:
name- The dotted decoder name.- Returns:
- This object.
-