ember-preferences
ember-preferences copied to clipboard
Cookie backend
Add the ability to configure a cookie based backend to store the preferences.
The idea is to give the user the option to use only cookie-based store, or to use the cookie-based store as a fallback for the local storage backend.
The configuration of the backend will be done via the preferences.js configuration file (see #1).
export default {
backends: ['local', 'cookie']
};
Where the backends value will be used as follows:
- If it's not defined, use
localStoragebackend andcookiebackend as fallback - If it's defined as an empty array, use
memorybackend (plain object see #3) - If it's
['cookie']usecookiebackend withmemoryas fallback - If it's
['local']uselocalStoragebackend withmemoryas fallback
Note that memory backend is always the last fallback.