diff --git a/README.md b/README.md index 7fb2c75..966cc4c 100644 --- a/README.md +++ b/README.md @@ -126,6 +126,31 @@ winEvents.off('scroll.down', firstListener); // the second listener will continue to work. ``` +### `winEvents.off(eventName, functionReference)` + +You can also unsubscribe a listener from an event by passing in the same function +that passed into the call to `on` or `once` + +```javascript +var myCallback = function(scrollData) { + console.log('We are scrolling down the page'); +} + +var mySecondCallback = function(scrollData) { + console.log('A second listener for scrolling down'); +} + +winEvents.on('scroll.down', myCallback); +winEvents.on('scroll.down', mySecondCallback); + +// Unsubscribe just the first Listener +winEvents.off('scroll.down', myCallback); + +// myCallback no longer fire +// when the window is scrolled down, but +// mySecondCallback will continue to work. +``` + ### `winEvents.getState()` Immediately get current size, scroll position, and visibility of the window. Returns an object with the following properties: diff --git a/jest.setup.js b/jest.setup.js index e6166fb..3bc3df1 100644 --- a/jest.setup.js +++ b/jest.setup.js @@ -16,7 +16,6 @@ global.window.resizeTo = (width, height) => { global.window.dispatchEvent(resizeEvent) } - global.beforeEach(() => { jest.clearAllMocks(); jest.useFakeTimers(); @@ -39,3 +38,8 @@ global.beforeEach(() => { writable: true, value: 'loading' }) }) + + +global.afterEach(() => { + jest.runAllTimers(); +}) diff --git a/package-lock.json b/package-lock.json index a844d52..b10febb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "windowevents", - "version": "1.1.0", + "version": "1.2.0", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -2582,9 +2582,9 @@ "dev": true }, "covjs": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/covjs/-/covjs-1.2.0.tgz", - "integrity": "sha1-akDf/UUG5LyzbHVhAlJW7NqSrmY=" + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/covjs/-/covjs-2.0.1.tgz", + "integrity": "sha512-gNoUmZLobQuCVDAo90FIADmxICKj8dA5Ok5nDcqETFwKLmHYI9ijaPDWgnHlpCHXhJMhWGCD8Ot3nIl4tFOH4w==" }, "cross-spawn": { "version": "7.0.3", diff --git a/package.json b/package.json index 30b5983..1f72dcb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "windowevents", - "version": "1.1.1", + "version": "1.2.0", "description": "Simple wrapper around common window events", "main": "windowevents.min.js", "license": "MIT", @@ -13,8 +13,8 @@ "lint": "standard src test", "start": "rollup -c -w", "build": "rollup -c", - "test": "jest test --coverage --verbose", - "test:watch": "jest test --watch" + "test": "jest --coverage --verbose", + "test:watch": "jest --watch" }, "browserslist": [ "> 0.5%", @@ -23,7 +23,7 @@ "IE 10" ], "dependencies": { - "covjs": "^1.2.0", + "covjs": "^2.0.1", "throttle-debounce": "^1.0.1" }, "devDependencies": { diff --git a/src/index.js b/src/index.js index 1d01664..fbc82c3 100644 --- a/src/index.js +++ b/src/index.js @@ -3,7 +3,7 @@ * @author Pete Droll * @license MIT */ -import publisher from 'covjs' +import { Covenant } from 'covjs' import debounce from 'throttle-debounce/debounce' import throttle from 'throttle-debounce/throttle' import ScrollEvents from './scroll' @@ -19,6 +19,8 @@ class WindowEvents { } this.options = opts ? { ...defaultOptions, ...opts } : defaultOptions + + const publisher = new Covenant() this.on = publisher.on this.once = publisher.once this.off = publisher.off diff --git a/test/resize-events.test.js b/test/resize-events.test.js index fca0f58..bf2e7ad 100644 --- a/test/resize-events.test.js +++ b/test/resize-events.test.js @@ -103,8 +103,10 @@ describe('Resize events', () => { winEvents.on('resize.scrollHeightChange', callback) - document.body.scrollHeight = 2500 + window.resizeTo(720, 480) window.resizeTo(320, 480) + document.body.scrollHeight = 2500 + jest.runAllTimers() expect(callback).toHaveBeenCalledWith({ orientation: 'portrait', diff --git a/test/scroll-events.test.js b/test/scroll-events.test.js index a35d048..7393ad4 100644 --- a/test/scroll-events.test.js +++ b/test/scroll-events.test.js @@ -33,10 +33,10 @@ describe('Scroll events', () => { window.scrollTo(0, 200) window.scrollTo(0, 311) - jest.advanceTimersByTime(99) + jest.advanceTimersByTime(90) expect(callback).toHaveBeenCalledTimes(1) - jest.advanceTimersByTime(2) + jest.advanceTimersByTime(12) expect(callback).toHaveBeenCalledTimes(2) }) }) diff --git a/test/windowevents.test.js b/test/windowevents.test.js index 83464e2..91f91ae 100644 --- a/test/windowevents.test.js +++ b/test/windowevents.test.js @@ -36,7 +36,7 @@ describe('WindowEvents', () => { }) describe('#off', () => { - it('removes a previously added event listener', () => { + it('removes a previously added event listener by token', () => { const winEvents = new WindowEvents() const callback = jest.fn() const callback2 = jest.fn() @@ -58,8 +58,30 @@ describe('WindowEvents', () => { expect(callback2).toHaveBeenCalledWith({ visible: true }) }) + it('removes a previously added event listener by function reference', () => { + const winEvents = new WindowEvents() + const callback = jest.fn() + const callback2 = jest.fn() + + winEvents.on('visibilityChange', callback) + winEvents.on('visibilityChange', callback2) + + document.hidden = true + window.dispatchEvent(new Event('visibilitychange')) + + expect(callback).toHaveBeenCalledWith({ visible: false }) + + winEvents.off('visibilityChange', callback2) + + document.hidden = false + window.dispatchEvent(new Event('visibilitychange')) + + expect(callback).toHaveBeenCalledWith({ visible: true }) + expect(callback2).not.toHaveBeenCalledWith({ visible: true }) + }) + describe('when a listener is not specified', () => { - it('removes all previously added event listener', () => { + it('removes all previously added event listeners', () => { const winEvents = new WindowEvents() const callback = jest.fn() const callback2 = jest.fn() @@ -79,6 +101,9 @@ describe('WindowEvents', () => { expect(callback).not.toHaveBeenCalledWith({ visible: true }) expect(callback2).not.toHaveBeenCalledWith({ visible: true }) + + expect(callback).toBeCalledTimes(1) + expect(callback2).toBeCalledTimes(1) }) }) }) diff --git a/windowevents.js b/windowevents.js index e54929e..9eac2d8 100644 --- a/windowevents.js +++ b/windowevents.js @@ -80,46 +80,44 @@ */ /** - * Checks if a variable is a function - * @param {Function} fn - * - * @returns {Boolean} + * Constuctor to create an object to hold all of the apps covenants. + * @type {Function} */ - function _isFn(fn) { - return Object.prototype.toString.call(fn) === '[object Function]'; - } - /** - * Store incrementing ID for each passed callback - * @type {Int} - */ - + function Covenant() { + /** + * Checks if a variable is a function + * @param {Function} fn + * + * @returns {Boolean} + */ + function isFn(fn) { + return Object.prototype.toString.call(fn) === '[object Function]'; + } + /** + * Store incrementing ID for each passed callback + * @type {Int} + */ - var callbackId = 0; - /** - * Store all of our covenants - * @type {Array} - */ - var covenants = []; - /** - * One object to hold all of the apps covenants. - * @type {Object} - */ + var callbackId = 0; + /** + * Store all of our covenants + * @type {Array} + */ - var Cov = { + var covenants = []; /** * Register an event, or add to an existing event * @param {String} name Name of the event like: 'loaded' * @param {Function} fn The closure to execute when signaled. * @return {Mixed} Unique ID for listener or false on incorrect parameters */ - on: function on() { + + this.on = function on() { var name = arguments.length <= 0 || arguments[0] === undefined ? false : arguments[0]; var fn = arguments.length <= 1 || arguments[1] === undefined ? false : arguments[1]; // Make sure the fn is a function - var isFn = _isFn(fn); - - if (name && fn && isFn) { + if (name && fn && isFn(fn)) { var _exists = false; var cbObj = { id: 'cov_' + ++callbackId, @@ -147,35 +145,42 @@ } return false; - }, - + }; /** * Register an event to fire only once * @param {String} name Name of the event like: 'loaded' * @param {Function} fn The closure to execute when signaled. * @return {Mixed} Unique ID for listener or false on incorrect parameters */ - once: function once() { + + + this.once = function once() { var name = arguments.length <= 0 || arguments[0] === undefined ? false : arguments[0]; var fn = arguments.length <= 1 || arguments[1] === undefined ? false : arguments[1]; - var newId = 'cov_' + (callbackId + 1); - var oneTimeFunc = function () { - fn.apply(null, arguments); - this.off(name, newId); - }.bind(this); + if (name && fn && isFn(fn)) { + var newId = 'cov_' + (callbackId + 1); - this.on(name, oneTimeFunc); - return newId; - }, + var oneTimeFunc = function () { + fn.apply(null, arguments); + this.off(name, newId); + }.bind(this); + this.on(name, oneTimeFunc); + return newId; + } + + return false; + }; /** * Signal an event and run all of its subscribed functions. * @param {String} name Name of the event like: 'loaded'; * @param {object[]} args Any arguments that need to be sent to the fn * @return {object} Current instance of Cov, to allow for chaining */ - signal: function signal() { + + + this.signal = function signal() { var name = arguments.length <= 0 || arguments[0] === undefined ? false : arguments[0]; var args = arguments.length <= 1 || arguments[1] === undefined ? [] : arguments[1]; @@ -191,15 +196,16 @@ } return this; - }, - + }; /** * Unregister (turn off) an event. - * @param {String} Name of the event like: 'loaded'; - * @param {String} ID of listener as returned by `on` function - * @return {object} Current instance of Cov, to allow for chaining + * @param {String} Name of the event like: 'loaded'; + * @param {String|Function} ID of listener as returned by `on` function, or the original function + * @return {object} Current instance of Cov, to allow for chaining */ - off: function off() { + + + this.off = function off() { var name = arguments.length <= 0 || arguments[0] === undefined ? false : arguments[0]; var id = arguments.length <= 1 || arguments[1] === undefined ? false : arguments[1]; @@ -212,7 +218,8 @@ } else { // Otherwise just remove specified callback cov.callbacks.forEach(function (cbObj, ix, callbacks) { - if (cbObj.id === id) { + // Remove based off ID or the reference of the function passed matches original + if (cbObj.id === id || isFn(id) && cbObj.fn === id) { callbacks.splice(ix, 1); } }); @@ -224,9 +231,14 @@ } return this; - } + }; + } + + var cov = new Covenant(); + var cov_1 = { + cov: cov, + Covenant: Covenant }; - var cov = Cov; /* eslint-disable no-undefined,no-param-reassign,no-shadow */ @@ -589,15 +601,16 @@ resizeDelay: 350 }; this.options = opts ? _objectSpread2(_objectSpread2({}, defaultOptions), opts) : defaultOptions; - this.on = cov.on; - this.once = cov.once; - this.off = cov.off; - var resizeEvents = new ResizeEvents(cov, this.options); // Pass resizeEvents object to scroll listener + var publisher = new cov_1.Covenant(); + this.on = publisher.on; + this.once = publisher.once; + this.off = publisher.off; + var resizeEvents = new ResizeEvents(publisher, this.options); // Pass resizeEvents object to scroll listener // in order to have access to window height, width - var scrollEvents = new ScrollEvents(cov, this.options, resizeEvents); - var visibilityEvents = new VisibilityEvents(cov, this.options); - var loadEvents = new LoadEvents(cov, this.options); + var scrollEvents = new ScrollEvents(publisher, this.options, resizeEvents); + var visibilityEvents = new VisibilityEvents(publisher, this.options); + var loadEvents = new LoadEvents(publisher, this.options); this.getState = function () { return _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({}, resizeEvents.getState()), scrollEvents.getState()), visibilityEvents.getState()), loadEvents.getState()); @@ -640,4 +653,4 @@ return WindowEvents; }))); -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoid2luZG93ZXZlbnRzLmpzIiwic291cmNlcyI6WyJub2RlX21vZHVsZXMvY292anMvY292LmpzIiwibm9kZV9tb2R1bGVzL3Rocm90dGxlLWRlYm91bmNlL3Rocm90dGxlLmpzIiwibm9kZV9tb2R1bGVzL3Rocm90dGxlLWRlYm91bmNlL2RlYm91bmNlLmpzIiwic3JjL3Njcm9sbC5qcyIsInNyYy9yZXNpemUuanMiLCJzcmMvdmlzaWJpbGl0eS5qcyIsInNyYy9sb2FkLmpzIiwic3JjL2luZGV4LmpzIl0sInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogQGF1dGhvciBEYXZlIERldm9yIDxkYXZlZGV2b3JAZ21haWwuY29tPlxuICovXG5cbi8qKlxuICogQ2hlY2tzIGlmIGEgdmFyaWFibGUgaXMgYSBmdW5jdGlvblxuICogQHBhcmFtICB7RnVuY3Rpb259IGZuXG4gKlxuICogQHJldHVybnMge0Jvb2xlYW59XG4gKi9cbmZ1bmN0aW9uIF9pc0ZuKGZuKSB7XG5cdHJldHVybiBPYmplY3QucHJvdG90eXBlLnRvU3RyaW5nLmNhbGwoZm4pID09PSAnW29iamVjdCBGdW5jdGlvbl0nO1xufVxuXG4vKipcbiAqIFN0b3JlIGluY3JlbWVudGluZyBJRCBmb3IgZWFjaCBwYXNzZWQgY2FsbGJhY2tcbiAqIEB0eXBlICB7SW50fVxuICovXG52YXIgY2FsbGJhY2tJZCA9IDA7XG5cbi8qKlxuICogU3RvcmUgYWxsIG9mIG91ciBjb3ZlbmFudHNcbiAqIEB0eXBlICB7QXJyYXl9XG4gKi9cbnZhciBjb3ZlbmFudHMgPSBbXTtcblxuLyoqXG4gKiBPbmUgb2JqZWN0IHRvIGhvbGQgYWxsIG9mIHRoZSBhcHBzIGNvdmVuYW50cy5cb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0FJLEVBQUFBLE1BQU0sQ0FBQ3VDLGdCQUFQLENBQXdCLGtCQUF4QixFQUE0Q0gsZ0JBQWdCLENBQUNiLGVBQTdELEVBQThFLEtBQTlFO0VBRUFQLEVBQUFBLFFBQVEsQ0FBQ3VCLGdCQUFULENBQTBCLGtCQUExQixFQUE4QyxZQUFNO0VBQ2xEO0VBQ0E7RUFDQSxJQUFBLEtBQUksQ0FBQzFDLFdBQUw7O0VBQ0F3QyxJQUFBQSxVQUFVLENBQUNkLGVBQVg7RUFDRCxHQUxELEVBS0csS0FMSDtFQU1EOzs7Ozs7OzsifQ== diff --git a/windowevents.min.js b/windowevents.min.js index baeda8b..a5b17eb 100644 --- a/windowevents.min.js +++ b/windowevents.min.js @@ -1 +1 @@ -!function(t,i){"object"==typeof exports&&"undefined"!=typeof module?module.exports=i():"function"==typeof define&&define.amd?define(i):(t="undefined"!=typeof globalThis?globalThis:t||self).WindowEvents=i()}(this,(function(){"use strict";function t(t,i){if(!(t instanceof i))throw new TypeError("Cannot call a class as a function")}function i(t,i){for(var e=0;et?a():!0!==i&&(n=setTimeout(s?c:a,void 0===s?t-h:t))}},d=function(t,i,e){return void 0===e?c(t,i,!1):c(t,e,!1!==i)},u=function(){function i(e,s,n){t(this,i),this.signal=e.signal,this.options=s,this.windowSize=n,this.scrollTimeout=null,this.debouncedListener=this.debouncedListener.bind(this),this.throttledListener=this.throttledListener.bind(this),this.updateState()}return e(i,[{key:"updateState",value:function(){this.scrollTop=this.lastScrollTop=window.scrollY||window.pageYOffset,this.scrollPercent=this.scrollTop/(this.windowSize.scrollHeight-this.windowSize.height)*100}},{key:"getState",value:function(){return{scrollTop:this.scrollTop,scrollPercent:this.scrollPercent}}},{key:"debouncedListener",value:function(){this.scrollTop=window.scrollY||window.pageYOffset,this.scrollPercent=this.scrollTop/(this.windowSize.scrollHeight-this.windowSize.height)*100,this.signal("scroll.start",[{scrollTop:this.scrollTop,scrollPercent:this.scrollPercent}]),this.lastScrollTop=this.scrollTop}},{key:"throttledListener",value:function(){var t=this;this.scrollTop=window.scrollY||window.pageYOffset,this.scrollPercent=this.scrollTop/(this.windowSize.scrollHeight-this.windowSize.height)*100;var i={scrollTop:this.scrollTop,scrollPercent:this.scrollPercent};this.signal("scroll",[i]),this.scrollTop>this.lastScrollTop?this.signal("scroll.down",[i]):this.scrollTop=100&&this.signal("scroll.bottom",[i]),clearTimeout(this.scrollTimeout),this.scrollTimeout=setTimeout((function(){t.signal("scroll.stop",[i])}),this.options.scrollDelay+1),this.lastScrollTop=this.scrollTop}}]),i}(),g=function(){function i(e,s){t(this,i),this.signal=e.signal,this.options=s,this.resizeTimeout=null,this.debouncedListener=this.debouncedListener.bind(this),this.throttledListener=this.throttledListener.bind(this),this.updateState()}return e(i,[{key:"updateState",value:function(){this.height=this.lastH=window.innerHeight,this.width=this.lastW=window.innerWidth,this.scrollHeight=this.lastS=document.body.scrollHeight,this.orientation=this.lastO=this.height>this.width?"portrait":"landscape"}},{key:"getState",value:function(){return{height:this.height,width:this.width,scrollHeight:this.scrollHeight,orientation:this.orientation}}},{key:"debouncedListener",value:function(){this.height=window.innerHeight,this.width=window.innerWidth,this.scrollHeight=document.body.scrollHeight,this.orientation=this.height>this.width?"portrait":"landscape";var t={height:this.height,width:this.width,scrollHeight:this.scrollHeight,orientation:this.orientation};this.signal("resize.start",[t]),this.lastH=this.height,this.lastW=this.width,this.lastS=this.scrollHeight}},{key:"throttledListener",value:function(){var t=this;this.height=window.innerHeight,this.width=window.innerWidth,this.scrollHeight=document.body.scrollHeight,this.orientation=this.height>this.width?"portrait":"landscape";var i={height:this.height,width:this.width,scrollHeight:this.scrollHeight,orientation:this.orientation};this.signal("resize",[i]),this.orientation!==this.lastO&&this.signal("resize.orientationChange",[i]),this.scrollHeight!==this.lastS&&this.signal("resize.scrollHeightChange",[i]),clearTimeout(this.scrollTimeout),this.scrollTimeout=setTimeout((function(){t.signal("resize.stop",[i])}),this.options.resizeDelay+1),this.lastH=this.height,this.lastW=this.width,this.lastS=this.scrollHeight,this.lastO=this.orientation}}]),i}(),f=function(){function i(e,s){t(this,i),this.signal=e.signal,this.options=s,this.changeListenter=this.changeListenter.bind(this),this.updateState()}return e(i,[{key:"updateState",value:function(){this.visible=!document.hidden}},{key:"getState",value:function(){return{visible:this.visible}}},{key:"changeListenter",value:function(){this.visible=!document.hidden;var t={visible:this.visible};this.signal("visibilityChange",[t]),this.visible?this.signal("visibilityChange.show",[t]):this.signal("visibilityChange.hide",[t])}}]),i}(),p=function(){function i(e,s){t(this,i),this.signal=e.signal,this.options=s,this.changeListenter=this.changeListenter.bind(this),this.updateState()}return e(i,[{key:"updateState",value:function(){this.loaded=document.readyState}},{key:"getState",value:function(){return{loaded:this.loaded}}},{key:"changeListenter",value:function(){this.loaded=document.readyState;var t={loaded:this.loaded};this.signal("load",[t]),"interactive"===this.loaded?this.signal("load.interactive",[t]):"complete"===this.loaded&&this.signal("load.complete",[t])}}]),i}();return function i(e){var s=this;t(this,i);var n={scrollDelay:100,resizeDelay:350};this.options=e?o(o({},n),e):n,this.on=a.on,this.once=a.once,this.off=a.off;var l=new g(a,this.options),h=new u(a,this.options,l),r=new f(a,this.options),w=new p(a,this.options);this.getState=function(){return o(o(o(o({},l.getState()),h.getState()),r.getState()),w.getState())},this.updateState=function(){return l.updateState(),h.updateState(),r.updateState(),w.updateState(),s.getState()},window.addEventListener("scroll",d(this.options.scrollDelay,!0,h.debouncedListener),!1),window.addEventListener("scroll",c(this.options.scrollDelay,!1,h.throttledListener),!1),window.addEventListener("resize",d(this.options.resizeDelay,!0,l.debouncedListener),!1),window.addEventListener("resize",c(this.options.resizeDelay,!1,l.throttledListener),!1),window.addEventListener("visibilitychange",r.changeListenter,!1),document.addEventListener("readystatechange",(function(){s.updateState(),w.changeListenter()}),!1)}})); \ No newline at end of file +!function(t,i){"object"==typeof exports&&"undefined"!=typeof module?module.exports=i():"function"==typeof define&&define.amd?define(i):(t="undefined"!=typeof globalThis?globalThis:t||self).WindowEvents=i()}(this,(function(){"use strict";function t(t,i){if(!(t instanceof i))throw new TypeError("Cannot call a class as a function")}function i(t,i){for(var e=0;et?a():!0!==i&&(s=setTimeout(n?c:a,void 0===n?t-h:t))}},a=function(t,i,e){return void 0===e?r(t,i,!1):r(t,e,!1!==i)},c=function(){function i(e,n,s){t(this,i),this.signal=e.signal,this.options=n,this.windowSize=s,this.scrollTimeout=null,this.debouncedListener=this.debouncedListener.bind(this),this.throttledListener=this.throttledListener.bind(this),this.updateState()}return e(i,[{key:"updateState",value:function(){this.scrollTop=this.lastScrollTop=window.scrollY||window.pageYOffset,this.scrollPercent=this.scrollTop/(this.windowSize.scrollHeight-this.windowSize.height)*100}},{key:"getState",value:function(){return{scrollTop:this.scrollTop,scrollPercent:this.scrollPercent}}},{key:"debouncedListener",value:function(){this.scrollTop=window.scrollY||window.pageYOffset,this.scrollPercent=this.scrollTop/(this.windowSize.scrollHeight-this.windowSize.height)*100,this.signal("scroll.start",[{scrollTop:this.scrollTop,scrollPercent:this.scrollPercent}]),this.lastScrollTop=this.scrollTop}},{key:"throttledListener",value:function(){var t=this;this.scrollTop=window.scrollY||window.pageYOffset,this.scrollPercent=this.scrollTop/(this.windowSize.scrollHeight-this.windowSize.height)*100;var i={scrollTop:this.scrollTop,scrollPercent:this.scrollPercent};this.signal("scroll",[i]),this.scrollTop>this.lastScrollTop?this.signal("scroll.down",[i]):this.scrollTop=100&&this.signal("scroll.bottom",[i]),clearTimeout(this.scrollTimeout),this.scrollTimeout=setTimeout((function(){t.signal("scroll.stop",[i])}),this.options.scrollDelay+1),this.lastScrollTop=this.scrollTop}}]),i}(),d=function(){function i(e,n){t(this,i),this.signal=e.signal,this.options=n,this.resizeTimeout=null,this.debouncedListener=this.debouncedListener.bind(this),this.throttledListener=this.throttledListener.bind(this),this.updateState()}return e(i,[{key:"updateState",value:function(){this.height=this.lastH=window.innerHeight,this.width=this.lastW=window.innerWidth,this.scrollHeight=this.lastS=document.body.scrollHeight,this.orientation=this.lastO=this.height>this.width?"portrait":"landscape"}},{key:"getState",value:function(){return{height:this.height,width:this.width,scrollHeight:this.scrollHeight,orientation:this.orientation}}},{key:"debouncedListener",value:function(){this.height=window.innerHeight,this.width=window.innerWidth,this.scrollHeight=document.body.scrollHeight,this.orientation=this.height>this.width?"portrait":"landscape";var t={height:this.height,width:this.width,scrollHeight:this.scrollHeight,orientation:this.orientation};this.signal("resize.start",[t]),this.lastH=this.height,this.lastW=this.width,this.lastS=this.scrollHeight}},{key:"throttledListener",value:function(){var t=this;this.height=window.innerHeight,this.width=window.innerWidth,this.scrollHeight=document.body.scrollHeight,this.orientation=this.height>this.width?"portrait":"landscape";var i={height:this.height,width:this.width,scrollHeight:this.scrollHeight,orientation:this.orientation};this.signal("resize",[i]),this.orientation!==this.lastO&&this.signal("resize.orientationChange",[i]),this.scrollHeight!==this.lastS&&this.signal("resize.scrollHeightChange",[i]),clearTimeout(this.scrollTimeout),this.scrollTimeout=setTimeout((function(){t.signal("resize.stop",[i])}),this.options.resizeDelay+1),this.lastH=this.height,this.lastW=this.width,this.lastS=this.scrollHeight,this.lastO=this.orientation}}]),i}(),u=function(){function i(e,n){t(this,i),this.signal=e.signal,this.options=n,this.changeListenter=this.changeListenter.bind(this),this.updateState()}return e(i,[{key:"updateState",value:function(){this.visible=!document.hidden}},{key:"getState",value:function(){return{visible:this.visible}}},{key:"changeListenter",value:function(){this.visible=!document.hidden;var t={visible:this.visible};this.signal("visibilityChange",[t]),this.visible?this.signal("visibilityChange.show",[t]):this.signal("visibilityChange.hide",[t])}}]),i}(),g=function(){function i(e,n){t(this,i),this.signal=e.signal,this.options=n,this.changeListenter=this.changeListenter.bind(this),this.updateState()}return e(i,[{key:"updateState",value:function(){this.loaded=document.readyState}},{key:"getState",value:function(){return{loaded:this.loaded}}},{key:"changeListenter",value:function(){this.loaded=document.readyState;var t={loaded:this.loaded};this.signal("load",[t]),"interactive"===this.loaded?this.signal("load.interactive",[t]):"complete"===this.loaded&&this.signal("load.complete",[t])}}]),i}();return function i(e){var n=this;t(this,i);var s={scrollDelay:100,resizeDelay:350};this.options=e?o(o({},s),e):s;var l=new h.Covenant;this.on=l.on,this.once=l.once,this.off=l.off;var f=new d(l,this.options),p=new c(l,this.options,f),v=new u(l,this.options),w=new g(l,this.options);this.getState=function(){return o(o(o(o({},f.getState()),p.getState()),v.getState()),w.getState())},this.updateState=function(){return f.updateState(),p.updateState(),v.updateState(),w.updateState(),n.getState()},window.addEventListener("scroll",a(this.options.scrollDelay,!0,p.debouncedListener),!1),window.addEventListener("scroll",r(this.options.scrollDelay,!1,p.throttledListener),!1),window.addEventListener("resize",a(this.options.resizeDelay,!0,f.debouncedListener),!1),window.addEventListener("resize",r(this.options.resizeDelay,!1,f.throttledListener),!1),window.addEventListener("visibilitychange",v.changeListenter,!1),document.addEventListener("readystatechange",(function(){n.updateState(),w.changeListenter()}),!1)}})); \ No newline at end of file