import { Injectable } from '@angular/core' ; @ Injectable ( ) export class InMemoryStorageService { protected entries : { [ key ] : any ; } = { } ; get ( key ) { if ( typeof this . entries [ key ] === 'undefined' ) { return null ; } return this . entries [ key ] ; } set ( key , value ) { this . entries [ key ] = value ; return this ; } destroy ( key ) { if ( typeof this . entries [ key ] === 'undefined' ) { return this ; } delete this . entries [ key ] ; return this ; } once ( key ) { const value = this . get ( key ) ; this . destroy ( key ) ; return value ; } static _ ( ) { return new InMemoryStorageService ( ) ; } }