選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

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