vue-screen
Advanced tools
Comparing version 2.0.3-alpha.3 to 2.0.4-alpha.4
@@ -80,15 +80,16 @@ 'use strict'; | ||
// triggers this hook when they are destroyed. | ||
// If useScreen() is used outside a component, this hook is never executed. | ||
vue.onUnmounted(function () { | ||
window.removeEventListener('resize', resizeListener_1); | ||
if ('removeEventListener' in query_1) { | ||
query_1.removeEventListener('change', updateOrientationPropperties); | ||
} | ||
else { | ||
// https://github.com/reegodev/vue-screen/issues/30 | ||
// query.removeListener is not deprecated for iOS 12 | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
query_1.removeListener(updateOrientationPropperties); | ||
} | ||
}); | ||
if (vue.getCurrentInstance()) { | ||
vue.onUnmounted(function () { | ||
window.removeEventListener('resize', resizeListener_1); | ||
if ('removeEventListener' in query_1) { | ||
query_1.removeEventListener('change', updateOrientationPropperties); | ||
} | ||
else { | ||
// https://github.com/reegodev/vue-screen/issues/30 | ||
// query.removeListener is not deprecated for iOS 12 | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
query_1.removeListener(updateOrientationPropperties); | ||
} | ||
}); | ||
} | ||
} | ||
@@ -199,14 +200,15 @@ return screen; | ||
// triggers this hook when they are destroyed. | ||
// If useGrid() is used outside a component, this hook is never executed. | ||
vue.onUnmounted(function () { | ||
if ('removeEventListener' in query) { | ||
query.removeEventListener('change', onChange); | ||
} | ||
else { | ||
// https://github.com/reegodev/vue-screen/issues/30 | ||
// query.removeListener is not deprecated for iOS 12 | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
query.removeListener(onChange); | ||
} | ||
}); | ||
if (vue.getCurrentInstance()) { | ||
vue.onUnmounted(function () { | ||
if ('removeEventListener' in query) { | ||
query.removeEventListener('change', onChange); | ||
} | ||
else { | ||
// https://github.com/reegodev/vue-screen/issues/30 | ||
// query.removeListener is not deprecated for iOS 12 | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
query.removeListener(onChange); | ||
} | ||
}); | ||
} | ||
}); | ||
@@ -213,0 +215,0 @@ }; |
@@ -1,2 +0,2 @@ | ||
import { reactive, onUnmounted } from 'vue'; | ||
import { reactive, getCurrentInstance, onUnmounted } from 'vue'; | ||
@@ -76,15 +76,16 @@ var inBrowser = typeof window !== 'undefined'; | ||
// triggers this hook when they are destroyed. | ||
// If useScreen() is used outside a component, this hook is never executed. | ||
onUnmounted(function () { | ||
window.removeEventListener('resize', resizeListener_1); | ||
if ('removeEventListener' in query_1) { | ||
query_1.removeEventListener('change', updateOrientationPropperties); | ||
} | ||
else { | ||
// https://github.com/reegodev/vue-screen/issues/30 | ||
// query.removeListener is not deprecated for iOS 12 | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
query_1.removeListener(updateOrientationPropperties); | ||
} | ||
}); | ||
if (getCurrentInstance()) { | ||
onUnmounted(function () { | ||
window.removeEventListener('resize', resizeListener_1); | ||
if ('removeEventListener' in query_1) { | ||
query_1.removeEventListener('change', updateOrientationPropperties); | ||
} | ||
else { | ||
// https://github.com/reegodev/vue-screen/issues/30 | ||
// query.removeListener is not deprecated for iOS 12 | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
query_1.removeListener(updateOrientationPropperties); | ||
} | ||
}); | ||
} | ||
} | ||
@@ -195,14 +196,15 @@ return screen; | ||
// triggers this hook when they are destroyed. | ||
// If useGrid() is used outside a component, this hook is never executed. | ||
onUnmounted(function () { | ||
if ('removeEventListener' in query) { | ||
query.removeEventListener('change', onChange); | ||
} | ||
else { | ||
// https://github.com/reegodev/vue-screen/issues/30 | ||
// query.removeListener is not deprecated for iOS 12 | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
query.removeListener(onChange); | ||
} | ||
}); | ||
if (getCurrentInstance()) { | ||
onUnmounted(function () { | ||
if ('removeEventListener' in query) { | ||
query.removeEventListener('change', onChange); | ||
} | ||
else { | ||
// https://github.com/reegodev/vue-screen/issues/30 | ||
// query.removeListener is not deprecated for iOS 12 | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
query.removeListener(onChange); | ||
} | ||
}); | ||
} | ||
}); | ||
@@ -209,0 +211,0 @@ }; |
{ | ||
"name": "vue-screen", | ||
"version": "2.0.3-alpha.3", | ||
"version": "2.0.4-alpha.4", | ||
"description": "Reactive screen size and media query states for Vue. Integrates with most UI frameworks out of the box.", | ||
@@ -5,0 +5,0 @@ "main": "dist/vue-screen.cjs.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
25662
636