import { ArgumentNullException } from "../Errors" ; import { IDataStorage } from "./Interfaces" ; import { ILogger } from "../Logging" ; export class MemoryStorage implements IDataStorage { private _logger : ILogger ; private _data : any ; constructor ( logger ) { if ( ! logger ) { throw new ArgumentNullException ( 'logger' ) ; } this . _logger = logger ; } save ( data ) { this . _data = data ; return Promise . resolve ( ) ; } load ( ) { return Promise . resolve ( this . _data || { } ) ; } } export default MemoryStorage ;