import Memento from "./Memento" ; export default class Originator { state : string ; constructor ( state ) { this . state = state ; } createMemento ( ) { console . log ( "creates a memento with a given state!" ) ; return new Memento ( this . state ) ; } setMemento ( memento ) { console . log ( "sets the state back" ) ; this . state = memento . state ; } }