From e39ef8823b91a91da94a90f479989272128071f8 Mon Sep 17 00:00:00 2001 From: "Jan T. Sott" Date: Sun, 21 Apr 2024 15:37:39 +0200 Subject: [PATCH] fix types --- src/index.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/index.ts b/src/index.ts index 7b44d64..2a370dd 100644 --- a/src/index.ts +++ b/src/index.ts @@ -58,10 +58,10 @@ export function createStore(initialValue: any, { _postMessageToManyOrigins(window, value); if (window.self === window.top) { - const iframes = document.querySelectorAll(iframeSelector); + const iframes = document.querySelectorAll(iframeSelector) as NodeListOf; - iframes.forEach(iframe => { - _postMessageToManyOrigins(iframe?.contentWindow, value) + iframes?.forEach(iframe => { + _postMessageToManyOrigins(iframe.contentWindow, value) }); } else { _postMessageToManyOrigins(window.parent, value)