@veltdev/react 4.5.2-beta.11 → 4.5.2-beta.12

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/cjs/index.js CHANGED
@@ -3,6 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var React = require('react');
6
+ var reactDom = require('react-dom');
6
7
 
7
8
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
9
 
@@ -144,13 +145,13 @@ var loadVelt = function (callback, version, staging, develop, proxyDomain, integ
144
145
  }
145
146
  };
146
147
 
147
- var VELT_SDK_VERSION = '4.5.2-beta.11';
148
+ var VELT_SDK_VERSION = '4.5.2-beta.12';
148
149
  var VELT_SDK_INIT_EVENT = 'onVeltInit';
149
150
  var VELT_TAB_ID = 'veltTabId';
150
151
  // integrity map for the Velt SDK
151
152
  // Note: generate integrity hashes with: https://www.srihash.org/
152
153
  var INTEGRITY_MAP = {
153
- '4.5.2-beta.11': 'sha384-zlXomcC9rDwpcmKm3m5xVdanWaZNX/TlUXH7Sa94bqjIGhJjHlwxEU8KcIeosOa0',
154
+ '4.5.2-beta.12': 'sha384-yrQgLPkPfx83/uzsQqXaW7ABGl2SMqLGKRnxfYHze796JB2QC1poRP28MhHE8LA3',
154
155
  };
155
156
 
156
157
  var SnippylyProvider = function (props) {
@@ -6803,7 +6804,14 @@ function useVeltEventCallback(action) {
6803
6804
  subscriptionRef.current.unsubscribe();
6804
6805
  }
6805
6806
  var subscription = (_a = client === null || client === void 0 ? void 0 : client.on(memoizedAction)) === null || _a === void 0 ? void 0 : _a.subscribe(function (data) {
6806
- setData(data);
6807
+ if (memoizedAction === 'initUpdate') {
6808
+ reactDom.flushSync(function () {
6809
+ setData(data);
6810
+ });
6811
+ }
6812
+ else {
6813
+ setData(data);
6814
+ }
6807
6815
  });
6808
6816
  // Store the new subscription
6809
6817
  subscriptionRef.current = subscription;