refactor stores.js to be more explicit

This commit is contained in:
Christopher Bisset 2022-08-22 11:00:08 +10:00
parent fa28d334e0
commit b29c79fe90

View file

@ -5,25 +5,18 @@ import { Device, User, ACL } from '$lib/common/classes';
// localStorage Stores (global scope, saves to the browser)
//
// used to store the value of an alert across all components
export const alertStore = writable('');
// used to determine if the API is functioning
export const apiTestStore = writable('');
// stores the theme
export const themeStore = writable('');
// stores URL and API Key
export const URLStore = writable('');
export const APIKeyStore = writable('');
// stores preauth key preference
export const preAuthHideStore = writable(false);
// stores search state
export const userSearchStore = writable('');
export const deviceSearchStore = writable('');
// stores sorting preferences
export const deviceSortStore = writable('id');
export const deviceSortDirectionStore = writable('ascending');
export const userSortStore = writable('id');
export const sortDirectionStore = writable('ascending');
// stores preauth key preference
export const preAuthHideStore = writable(false);
//
// Normal Stores (global scope, saves until refresh)
@ -35,4 +28,11 @@ export const userFilterStore = writable([new User()]);
export const deviceStore = writable([new Device()]);
export const deviceFilterStore = writable([new Device()]);
// stores ACL object
export const aclStore = writable(new ACL());
export const aclStore = writable(new ACL());
// used to store the value of an alert across all components
export const alertStore = writable('');
// used to determine if the API is functioning
export const apiTestStore = writable('');
// stores search state
export const userSearchStore = writable('');
export const deviceSearchStore = writable('');