forked from MapComplete/MapComplete
		
	Refactoring: move all code files into a src directory
This commit is contained in:
		
							parent
							
								
									de99f56ca8
								
							
						
					
					
						commit
						e75d2789d2
					
				
					 389 changed files with 0 additions and 12 deletions
				
			
		
							
								
								
									
										15
									
								
								src/UI/Base/Lazy.ts
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										15
									
								
								src/UI/Base/Lazy.ts
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,15 @@ | |||
| import BaseUIElement from "../BaseUIElement" | ||||
| 
 | ||||
| export default class Lazy extends BaseUIElement { | ||||
|     private readonly _f: () => BaseUIElement | ||||
| 
 | ||||
|     constructor(f: () => BaseUIElement) { | ||||
|         super() | ||||
|         this._f = f | ||||
|     } | ||||
| 
 | ||||
|     protected InnerConstructElement(): HTMLElement { | ||||
|         // The caching of the BaseUIElement will guarantee that _f will only be called once
 | ||||
|         return this._f().ConstructElement() | ||||
|     } | ||||
| } | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue