2022-04-04 19:15:29 +00:00
|
|
|
import { IPreferences } from '../../../definitions';
|
2022-04-07 13:13:19 +00:00
|
|
|
import userPreferences from '../../methods/userPreferences';
|
2022-04-04 19:15:29 +00:00
|
|
|
|
|
|
|
const SORT_PREFS_KEY = 'RC_SORT_PREFS_KEY';
|
|
|
|
|
|
|
|
export function getSortPreferences() {
|
|
|
|
return userPreferences.getMap(SORT_PREFS_KEY);
|
|
|
|
}
|
|
|
|
|
|
|
|
export function saveSortPreference(param: Partial<IPreferences>) {
|
|
|
|
let prefs = getSortPreferences();
|
|
|
|
prefs = { ...prefs, ...param } as object;
|
|
|
|
return userPreferences.setMap(SORT_PREFS_KEY, prefs);
|
|
|
|
}
|