diff --git a/lib/useKResponsiveWindow/MediaQuery.js b/lib/useKResponsiveWindow/MediaQuery.js index e919566a8..627bab61b 100644 --- a/lib/useKResponsiveWindow/MediaQuery.js +++ b/lib/useKResponsiveWindow/MediaQuery.js @@ -10,13 +10,17 @@ export default class MediaQuery { constructor(query, eventHandler) { this.query = query; this.eventHandler = eventHandler; + this._mediaQueryList = null; } /** * @returns {Object} Media query list */ get mediaQueryList() { - return window.matchMedia(this.query); + if (!this._mediaQueryList) { + this._mediaQueryList = window.matchMedia(this.query); + } + return this._mediaQueryList; } /**