tldraw/state/session.ts
2021-06-06 11:50:01 +01:00

27 lines
430 B
TypeScript

import { BaseSession } from './sessions'
class SessionManager {
private _current?: BaseSession
clear() {
this._current = undefined
return this
}
setCurrent(session: BaseSession) {
this._current = session
return this
}
get current() {
return this._current
}
set current(session: BaseSession) {
this._current = session
}
}
const session = new SessionManager()
export default session