import { BaseSession } from './sessions' class SessionManager { private _current?: BaseSession clear() { this._current = undefined return this } setCurrent(session: BaseSession) { this._current = session return this } update(...args: Parameters) { this._current.update.call(null, ...args) return this } begin(session: BaseSession) { this._current = session return this } complete(...args: Parameters) { this._current.complete.call(null, ...args) return this } cancel(...args: Parameters) { this._current.cancel.call(null, ...args) return this } } const session = new SessionManager() export default session