add storage events change handling
This commit is contained in:
		
							parent
							
								
									84c09c0b47
								
							
						
					
					
						commit
						94b01ea25b
					
				
					 1 changed files with 11 additions and 0 deletions
				
			
		|  | @ -382,3 +382,14 @@ export function init(data) { | ||||||
|     }); |     }); | ||||||
|   } |   } | ||||||
| } | } | ||||||
|  | 
 | ||||||
|  | /* | ||||||
|  | Run a script when the browser storage has been changed. | ||||||
|  | 
 | ||||||
|  | @param {object} reaction the function to run | ||||||
|  | */ | ||||||
|  | export async function observe(reaction) { | ||||||
|  |   chrome.storage.onChanged.addListener((changes, namespace) => { | ||||||
|  |     reaction(changes, namespace); | ||||||
|  |   }); | ||||||
|  | } | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue