@quilted/threads
Advanced tools
Comparing version 0.0.0-preview-20230216194909 to 0.0.0-preview-20230217065602
# @quilted/threads | ||
## 0.0.0-preview-20230216194909 | ||
## 0.0.0-preview-20230217065602 | ||
### Patch Changes | ||
- Add thread target utilities for iframes | ||
- Fix outer iframe target helper | ||
## 0.1.13 | ||
### Patch Changes | ||
- [`4e871d12`](https://github.com/lemonmade/quilt/commit/4e871d1235847dc472f5aab59412761d57fdeea1) Thanks [@lemonmade](https://github.com/lemonmade)! - Fix outer iframe target helper | ||
## 0.1.12 | ||
@@ -10,0 +16,0 @@ |
@@ -5,3 +5,3 @@ { | ||
"type": "module", | ||
"version": "0.0.0-preview-20230216194909", | ||
"version": "0.0.0-preview-20230217065602", | ||
"license": "MIT", | ||
@@ -8,0 +8,0 @@ "engines": { |
@@ -12,3 +12,3 @@ import {on} from '@quilted/events'; | ||
const sendMessage: ThreadTarget['send'] = function send(message, transfer) { | ||
iframe.contentWindow!.postMessage(message, targetOrigin, transfer); | ||
iframe.contentWindow?.postMessage(message, targetOrigin, transfer); | ||
}; | ||
@@ -46,3 +46,3 @@ | ||
const messages = on<WindowEventHandlersEventMap, 'message'>( | ||
iframe, | ||
self, | ||
'message', | ||
@@ -55,2 +55,3 @@ { | ||
for await (const message of messages) { | ||
if (message.source !== iframe.contentWindow) continue; | ||
if (message.data === RESPONSE_MESSAGE) continue; | ||
@@ -57,0 +58,0 @@ yield message.data; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
165161
2966