lib/tool.js
function ready(period, filter) {
						var tasty = this;
						tasty.hooks.set(
							filter,
							function(result) {
								return tasty.utils.thenable(
									// eslint-disable-next-line no-undef
									document.readyState === 'complete' ?
										result :
										function(resolve) {
											// eslint-disable-next-line no-undef
											tasty.dom.on(window, 'load', resolve);
										}
								).then(function() {
									return period ?
										tasty.utils.delay(period, result) :
										result;
								});
							},
							period ?
								'ready:window ' + period :
								'ready:window'
						);
					}
function ready(period, filter) {
						var tasty = this;
						tasty.hooks.set(
							filter,
							function(result) {
								return tasty.utils.thenable(
									// eslint-disable-next-line no-undef
									document.readyState === 'complete' ?
										result :
										function(resolve) {
											// eslint-disable-next-line no-undef
											tasty.dom.on(window, 'load', resolve);
										}
								).then(function() {
									return period ?
										tasty.utils.delay(period, result) :
										result;
								});
							},
							period ?
								'ready:window ' + period :
								'ready:window'
						);
					}
istanbul ignore next