import Bacon = require ( 'baconjs' ) ; import CoordsModel from '../model/coords' ; import Point from 'slime-finder/point' ; export default class AtlasModel { readonly centerChanges : Bacon . Bus < ( p : Point ) => Point > ; readonly center : Bacon . Property < Point > ; readonly scaleChanges : Bacon . Bus < ( s : number ) => number > ; readonly scale : Bacon . Property < number > ; constructor ( coords , initialScale ) { this . centerChanges = coords . changes ; this . center = coords . prop ; this . scaleChanges = new Bacon . Bus < ( s : number ) => number > ( ) ; this . scale = this . scaleChanges . scan ( initialScale , ( s0 , f ) => { return f ( s0 ) ; } ) . skipDuplicates ( ) ; } }