import IStoreWriter from "./IStoreWriter" ; import IStoreReader from "./IStoreReader" ; export default class MessageStore { writer : IStoreWriter ; reader : IStoreReader ; constructor ( writer , reader ) { if ( writer === null ) { throw new Error ( "writer argument cannot be null" ) ; } if ( reader === null ) { throw new Error ( "reader argument cannot be null" ) ; } this . writer = writer ; this . reader = reader ; } param id param message public save ( id , message ) { this . writer . save ( id , message ) ; } param id returns public read ( id ) { return this . reader . read ( id ) ; } }