Types shared user preferences
I propose to store the user preferences as a global dict for available keys, including default values and validation.
Basically
const mapping = {
['tomo/tiling/defaultlut', 'Cividis', ColorMap],
...
}
// Plus the public API
As result the use of such API could be something like
const [color, setColor] = useUserPreference<ColorMap>('tomo/tiling/defaultlut')
Or like that
const [color, setColor] = useColorMapAsUserPreference('tomo/tiling/defaultlut')
- The user preferences have to be shared -> there is no reason to describe de default and type at many places
- I would like to catch wrong content in order to safely migrate beamlines (for now it's not a problem cause this stuff is not persistent server side)
- This can be global, or decoupled per modules with a registration function
What do you think?