@veltdev/react 1.0.135 → 1.0.136

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
@@ -140,7 +140,7 @@ var loadVelt = function (callback, version, staging, develop, proxyDomain) {
140
140
  }
141
141
  };
142
142
 
143
- var VELT_SDK_VERSION = '1.0.152';
143
+ var VELT_SDK_VERSION = '1.0.153';
144
144
  var VELT_SDK_INIT_EVENT = 'onVeltInit';
145
145
 
146
146
  var SnippylyProvider = function (props) {
@@ -2168,6 +2168,21 @@ function useSetLocation(location, appendLocation) {
2168
2168
  client && client.setLocation(location, appendLocation);
2169
2169
  }, [client]);
2170
2170
  }
2171
+ function useVeltInitState() {
2172
+ var client = useVeltClient().client;
2173
+ var _a = React__default["default"].useState(), data = _a[0], setData = _a[1];
2174
+ React__default["default"].useEffect(function () {
2175
+ if (!(client === null || client === void 0 ? void 0 : client.getVeltInitState$))
2176
+ return;
2177
+ var subscription = client === null || client === void 0 ? void 0 : client.getVeltInitState$().subscribe(function (res) {
2178
+ setData(res);
2179
+ });
2180
+ return function () {
2181
+ subscription.unsubscribe();
2182
+ };
2183
+ }, [client === null || client === void 0 ? void 0 : client.getVeltInitState$]);
2184
+ return data;
2185
+ }
2171
2186
 
2172
2187
  function useCommentUtils() {
2173
2188
  var _a = React__default["default"].useState(), commentElement = _a[0], setCommentElement = _a[1];
@@ -2858,5 +2873,6 @@ exports.useUniqueViewsByUser = useUniqueViewsByUser;
2858
2873
  exports.useUnsetDocumentId = useUnsetDocumentId;
2859
2874
  exports.useUserEditorState = useUserEditorState;
2860
2875
  exports.useVeltClient = useVeltClient;
2876
+ exports.useVeltInitState = useVeltInitState;
2861
2877
  exports.useViewsUtils = useViewsUtils;
2862
2878
  //# sourceMappingURL=index.js.map