You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

session.ts 430B

123456789101112131415161718192021222324252627
  1. import { BaseSession } from './sessions'
  2. class SessionManager {
  3. private _current?: BaseSession
  4. clear() {
  5. this._current = undefined
  6. return this
  7. }
  8. setCurrent(session: BaseSession) {
  9. this._current = session
  10. return this
  11. }
  12. get current() {
  13. return this._current
  14. }
  15. set current(session: BaseSession) {
  16. this._current = session
  17. }
  18. }
  19. const session = new SessionManager()
  20. export default session