export class SessionService { private static instance?: SessionService public static get(): SessionService { if ( !this.instance ) { this.instance = new SessionService() } return this.instance } protected data: {[key: string]: any} = {} populate(data: {[key: string]: any}) { this.data = data } get(key: string, fallback?: any): any { return this.data[key] ?? fallback } set(key: string, value: any) { this.data[key] = value } }