import Observer from "./Observer" ; export default class InputText { observers : Observer [ ] ; constructor ( ) { this . observers = [ ] ; } register ( observer ) { this . observers . push ( observer ) ; } unregister ( observer ) { const position = this . observers . indexOf ( observer ) ; this . observers . splice ( position , 1 ) ; } notifyAll ( ) { this . observers . forEach ( observer => observer . update ( ) ) ; } }