forked from MapComplete/MapComplete
		
	Refactoring: re-enable caching
This commit is contained in:
		
							parent
							
								
									59544ec073
								
							
						
					
					
						commit
						476423f9d1
					
				
					 5 changed files with 19 additions and 3 deletions
				
			
		|  | @ -240,6 +240,12 @@ export abstract class Store<T> implements Readable<T> { | |||
|         return newSource | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * Converts the uiEventSource into a promise. | ||||
|      * The promise will return the value of the store if the given condition evaluates to true | ||||
|      * @param condition: an optional condition, default to 'store.value !== undefined' | ||||
|      * @constructor | ||||
|      */ | ||||
|     public AsPromise(condition?: (t: T) => boolean): Promise<T> { | ||||
|         const self = this | ||||
|         condition = condition ?? ((t) => t !== undefined) | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue