hoist-react icon indicating copy to clipboard operation
hoist-react copied to clipboard

Support persisting different aspect of component state to distinct persist providers

Open amcclain opened this issue 2 years ago • 1 comments

Hoist models that support the persistWith API currently accept a single persistence provider, which is expected to persist all state. Some models - GridModel, FilterChooserModel, GroupingChooserModel - expose custom persist options to allow developers to turn on/off different parts of their state, but still all enabled state is saved to the same place.

We would like to allow different components of the state (for a single model) to be saved to entirely different providers. E.g. for a filter/groupingChooser used within a dashboard, we might wish to save favorites to a preference, so the user has the same faves available for all instances of a single widget, while saving value to the specific widget state.

For GridModel, we might wish to persist column sizing locally, while saving other state to a pref or persisted view. (Note that GridModel does not currently produce distinct chunks of state for col size vs viz, but it could)

amcclain avatar Jun 17 '22 20:06 amcclain