mirror of
				https://github.com/mickael-kerjean/filestash.git
				synced 2025-10-31 18:16:00 +08:00 
			
		
		
		
	
		
			
				
	
	
		
			16 lines
		
	
	
		
			413 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			16 lines
		
	
	
		
			413 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
| const Prompt = function (){
 | |
|     let fn = null;
 | |
| 
 | |
|     return {
 | |
|         now: function(text, okCallback, cancelCallback, type){
 | |
|             if(!fn){ return window.setTimeout(() => this.now(text, okCallback, cancelCallback, type), 50); }
 | |
|             fn(text, okCallback, cancelCallback, type);
 | |
|         },
 | |
|         subscribe: function(_fn){
 | |
|             fn = _fn;
 | |
|         }
 | |
|     };
 | |
| };
 | |
| 
 | |
| export const prompt = new Prompt();
 | 
