forked from MapComplete/MapComplete
		
	First steps for a decent custom theme generator
This commit is contained in:
		
							parent
							
								
									a57b7d93fa
								
							
						
					
					
						commit
						2052976909
					
				
					 82 changed files with 1880 additions and 1311 deletions
				
			
		|  | @ -8,17 +8,18 @@ export class UIEventSource<T>{ | |||
|     } | ||||
| 
 | ||||
| 
 | ||||
|     public addCallback(callback: ((latestData : T) => void)) { | ||||
|     public addCallback(callback: ((latestData : T) => void)) : UIEventSource<T>{ | ||||
|         this._callbacks.push(callback); | ||||
|         return this; | ||||
|     } | ||||
| 
 | ||||
|     public setData(t: T): void { | ||||
|     public setData(t: T): UIEventSource<T> { | ||||
|         if (this.data === t) { | ||||
|             return; | ||||
|         } | ||||
|         this.data = t; | ||||
|         this.ping(); | ||||
|         return this; | ||||
|     } | ||||
| 
 | ||||
|     public ping(): void { | ||||
|  | @ -55,7 +56,6 @@ export class UIEventSource<T>{ | |||
|          | ||||
|         const update = function () { | ||||
|             newSource.setData(f(self.data)); | ||||
|             newSource.ping(); | ||||
|         } | ||||
| 
 | ||||
|         this.addCallback(update); | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue