06500be757
* refactor(storage): replace Tracker.Dependency with observer hook * fix(storage): set initial value * refactor(storage): stop using Meteor's Session singleton
16 lines
469 B
TypeScript
16 lines
469 B
TypeScript
import Local from './local';
|
|
import ObservableStorage from './observable';
|
|
import Session from './session';
|
|
|
|
let StorageSingleton: ObservableStorage | null = null;
|
|
export const getStorageSingletonInstance = () => {
|
|
const APP_CONFIG = window.meetingClientSettings.public.app;
|
|
|
|
if (!StorageSingleton) {
|
|
StorageSingleton = APP_CONFIG.userSettingsStorage === 'local' ? Local : Session;
|
|
}
|
|
return StorageSingleton;
|
|
};
|
|
|
|
export default getStorageSingletonInstance;
|