module Sfx { export class Observable { private observers : ( ( key : string , oldValue : any , newValue : any ) => void ) [ ] = [ ] ; public subscribe ( observer ) { this . observers . push ( observer ) ; } protected notify ( key , oldValue , newValue ) { if ( this . observers && this . observers . length > 0 ) { this . observers . forEach ( observer => { observer ( key , oldValue , newValue ) ; } ) ; } } } }