You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					15 lines
				
				266 B
			
		
		
			
		
	
	
					15 lines
				
				266 B
			| 
								 
											3 years ago
										 
									 | 
							
								define(function () {
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								  // Returns a function that will only be executed on and after the Nth call.
							 | 
						||
| 
								 | 
							
								  function after(times, func) {
							 | 
						||
| 
								 | 
							
								    return function() {
							 | 
						||
| 
								 | 
							
								      if (--times < 1) {
							 | 
						||
| 
								 | 
							
								        return func.apply(this, arguments);
							 | 
						||
| 
								 | 
							
								      }
							 | 
						||
| 
								 | 
							
								    };
							 | 
						||
| 
								 | 
							
								  }
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								  return after;
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								});
							 |