migrate to typescript, with fixes
This commit is contained in:
		
							
								
								
									
										15
									
								
								src/background/caches.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										15
									
								
								src/background/caches.ts
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,15 @@ | ||||
| import { logger } from "./common"; | ||||
|  | ||||
| export class Caches { | ||||
|     private _state: string = ""; | ||||
|     constructor() { } | ||||
|     get state(): string { | ||||
|         let s = this._state; | ||||
|         this._state = ""; | ||||
|         return s; | ||||
|     } | ||||
|     setState(name: string, content: string) { | ||||
|         this._state = content; | ||||
|         logger.info(`State (${name}) recieved. To load it: some_var = new Extractor().load()`); | ||||
|     } | ||||
| } | ||||
		Reference in New Issue
	
	Block a user