TypeDoc all the thngs
This commit is contained in:
@@ -1,10 +1,17 @@
|
||||
import {NoSessionKeyError, Session, SessionData, SessionNotLoadedError} from "./Session";
|
||||
import {Injectable} from "@extollo/di";
|
||||
|
||||
/**
|
||||
* Implementation of the session driver that stores session data in memory.
|
||||
* This is the default, for compatibility, but it is recommended that you replace
|
||||
* this driver with one with a persistent backend.
|
||||
*/
|
||||
@Injectable()
|
||||
export class MemorySession extends Session {
|
||||
/** Mapping of session key to session data object. */
|
||||
private static sessionsByID: {[key: string]: SessionData} = {}
|
||||
|
||||
/** Get a particular session by ID. */
|
||||
private static getSession(id: string) {
|
||||
if ( !this.sessionsByID[id] ) {
|
||||
this.sessionsByID[id] = {} as SessionData
|
||||
@@ -13,11 +20,15 @@ export class MemorySession extends Session {
|
||||
return this.sessionsByID[id]
|
||||
}
|
||||
|
||||
/** Store the given session data by its ID. */
|
||||
private static setSession(id: string, data: SessionData) {
|
||||
this.sessionsByID[id] = data
|
||||
}
|
||||
|
||||
/** The ID of this session. */
|
||||
protected sessionID?: string
|
||||
|
||||
/** The associated data for this session. */
|
||||
protected data?: SessionData
|
||||
|
||||
constructor() { super() }
|
||||
|
||||
Reference in New Issue
Block a user