lib/client/scene.js
function check() {

		var el,
		    i;

		// Return early if no elements need to be checked
		if (!elements.length) {
			return;
		}

		for (i = 0; i < elements.length; i++) {
			el = elements[i];

			if (el.isVisible(options.padding)) {
				if (live) {
					el.classList.remove(query);
				} else {
					elements.splice(i, 1);
				}

				i--;
				callback(el);

				// If delay_callback is true,
				// wait until the next check to call another item
				if (options.delay_callback) {
					req();
					break;
				}
			}
		}

		// Stop all future checks if no elements are left and it's not live
		if (!live && !elements.length) {
			document.removeEventListener('wheel', req);
			document.removeEventListener('click', req);
			document.removeEventListener('scroll', req);
			that.removeListener('rendered', req);
			clearInterval(intervalId);
			queue.destroy();
		}
	}
function check() {

		var el,
		    i;

		// Return early if no elements need to be checked
		if (!elements.length) {
			return;
		}

		for (i = 0; i < elements.length; i++) {
			el = elements[i];

			if (el.isVisible(options.padding)) {
				if (live) {
					el.classList.remove(query);
				} else {
					elements.splice(i, 1);
				}

				i--;
				callback(el);

				// If delay_callback is true,
				// wait until the next check to call another item
				if (options.delay_callback) {
					req();
					break;
				}
			}
		}

		// Stop all future checks if no elements are left and it's not live
		if (!live && !elements.length) {
			document.removeEventListener('wheel', req);
			document.removeEventListener('click', req);
			document.removeEventListener('scroll', req);
			that.removeListener('rendered', req);
			clearInterval(intervalId);
			queue.destroy();
		}
	}
function check ( ) { var el , i ; // Return early if no elements need to be checked if ( ! elements . length ) { return ; } for ( i = 0 ; i < elements . length ; i ++ ) { el = elements [ i ] ; if ( el . isVisible ( options . padding ) ) { if ( live ) { el . classList . remove ( query ) ; } else { elements . splice ( i , 1 ) ; } i -- ; callback ( el ) ; // If delay_callback is true, // wait until the next check to call another item if ( options . delay_callback ) { req ( ) ; break ; } } } // Stop all future checks if no elements are left and it's not live if ( ! live && ! elements . length ) { document . removeEventListener ( 'wheel' , req ) ; document . removeEventListener ( 'click' , req ) ; document . removeEventListener ( 'scroll' , req ) ; that . removeListener ( 'rendered' , req ) ; clearInterval ( intervalId ) ; queue . destroy ( ) ; } }
The actual check
The actual check