@sanity/client 6.18.0-canary.0 → 6.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.browser.cjs +5 -8
- package/dist/index.browser.cjs.map +1 -1
- package/dist/index.browser.js +5 -8
- package/dist/index.browser.js.map +1 -1
- package/dist/index.cjs +6 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +6 -9
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/src/data/listen.ts +1 -5
- package/src/data/live.ts +2 -6
- package/umd/sanityClient.js +5 -8
- package/umd/sanityClient.min.js +1 -1
package/dist/index.browser.cjs
CHANGED
|
@@ -904,7 +904,7 @@ function _listen(query, params, opts = {}) {
|
|
|
904
904
|
}
|
|
905
905
|
function open() {
|
|
906
906
|
getEventSource().then((eventSource) => {
|
|
907
|
-
eventSource && (es = eventSource
|
|
907
|
+
eventSource && (es = eventSource);
|
|
908
908
|
}).catch((reason) => {
|
|
909
909
|
observer.error(reason), stop();
|
|
910
910
|
});
|
|
@@ -951,13 +951,10 @@ class LiveClient {
|
|
|
951
951
|
open();
|
|
952
952
|
function onError(evt) {
|
|
953
953
|
if (!stopped) {
|
|
954
|
-
if ("data" in evt)
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
} catch (err) {
|
|
959
|
-
observer.error(err);
|
|
960
|
-
}
|
|
954
|
+
if ("data" in evt) {
|
|
955
|
+
const event = parseEvent(evt);
|
|
956
|
+
observer.error(new Error(event.message, { cause: event }));
|
|
957
|
+
}
|
|
961
958
|
es.readyState === es.CLOSED && (unsubscribe(), clearTimeout(reconnectTimer), reconnectTimer = setTimeout(open, 100));
|
|
962
959
|
}
|
|
963
960
|
}
|