tessl install tessl/npm-store@2.0.0A localStorage wrapper for all browsers without using cookies or flash, providing persistent client-side storage with automatic fallback and plugin architecture
Agent Success
Agent success rate when using this tile
75%
Improvement
Agent success rate improvement when using this tile compared to baseline
0.96x
Baseline
Agent success rate without this tile
78%
Build a user preferences manager that retrieves and manages application settings using persistent storage.
Create a module that retrieves user preference values from storage with appropriate fallback defaults when preferences haven't been set yet.
Your implementation should:
theme), defaulting to "light" if not setlanguage), defaulting to "en" if not setnotifications), defaulting to true if not setdashboardLayout), defaulting to { columns: 2, widgets: [] } if not setAll preferences should be retrieved from persistent storage and return the appropriate default value when the preference hasn't been saved.
@generates
/**
* Gets the user's theme preference
* @returns {string} The theme preference or "light" if not set
*/
function getTheme() {
// Implementation here
}
/**
* Gets the user's language preference
* @returns {string} The language preference or "en" if not set
*/
function getLanguage() {
// Implementation here
}
/**
* Gets the user's notification setting
* @returns {boolean} The notification setting or true if not set
*/
function getNotifications() {
// Implementation here
}
/**
* Gets the user's dashboard layout configuration
* @returns {object} The dashboard layout or { columns: 2, widgets: [] } if not set
*/
function getDashboardLayout() {
// Implementation here
}
module.exports = {
getTheme,
getLanguage,
getNotifications,
getDashboardLayout
};getTheme() returns "light" @testgetLanguage() returns "en" @testgetNotifications() returns true @testgetDashboardLayout() returns { columns: 2, widgets: [] } @testProvides persistent client-side storage functionality.
@satisfied-by