aboutsummaryrefslogtreecommitdiffstats
path: root/src/utils/window.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils/window.js')
-rw-r--r--src/utils/window.js10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/utils/window.js b/src/utils/window.js
index 626fde3..5009c77 100644
--- a/src/utils/window.js
+++ b/src/utils/window.js
@@ -3,30 +3,30 @@ export const globals = {
document: typeof document === 'undefined' ? null : document
}
-export function registerWindow (win = null, doc = null) {
+export function registerWindow(win = null, doc = null) {
globals.window = win
globals.document = doc
}
const save = {}
-export function saveWindow () {
+export function saveWindow() {
save.window = globals.window
save.document = globals.document
}
-export function restoreWindow () {
+export function restoreWindow() {
globals.window = save.window
globals.document = save.document
}
-export function withWindow (win, fn) {
+export function withWindow(win, fn) {
saveWindow()
registerWindow(win, win.document)
fn(win, win.document)
restoreWindow()
}
-export function getWindow () {
+export function getWindow() {
return globals.window
}