Retrieves the current user preferences.
A Promise that resolves to the retrieved user preferences.
Updates the user preferences with the provided preferences data.
The preferences object containing marketing and data preferences to update.
A Promise that resolves to the updated user preferences.
// Example usage:
const updatedPreferences = {
marketing: {
receiveMarketingEmails: true,
receivePushNotifications: false
},
data: {
consentForAnalytics: true
}
};
preferencesService.update(updatedPreferences)
.then((preferences) => {
console.log('Preferences updated:', preferences);
})
.catch((error) => {
console.error('Error updating preferences.');
});
StaticgetFunctionRetrieves the singleton instance of the PreferencesService class.
The singleton instance of the PreferencesService class.
Service class for managing user preferences related operations.