Raxol.Core.UserPreferences (Raxol v0.2.0)
View SourceManages user preferences for the Raxol application.
Acts as a GenServer holding the preferences state and handles persistence.
Summary
Functions
Returns a specification to start this module under a supervisor.
Gets a user preference value by key path.
Retrieves the entire preferences map.
Forces an immediate save of the current preferences.
Sets a user preference value by key path.
Functions
Returns a specification to start this module under a supervisor.
See Supervisor
.
Gets a user preference value by key path.
Accepts a single key or a list of keys for nested access.
Examples
UserPreferences.get(:theme) #=> "dark"
UserPreferences.get([:accessibility, :high_contrast]) #=> true
Retrieves the entire preferences map.
Forces an immediate save of the current preferences.
Sets a user preference value by key path.
Accepts a single key or a list of keys for nested access. Triggers an automatic save after a short delay.
Examples
UserPreferences.set(:theme, "light")
UserPreferences.set([:accessibility, :high_contrast], false)