react-instantsearch-core
7.25.07.26.0
dist/cjs/components/InstantSearch.js~
dist/cjs/components/InstantSearch.jsModified+34−36
Index: package/dist/cjs/components/InstantSearch.js
===================================================================
--- package/dist/cjs/components/InstantSearch.js
+++ package/dist/cjs/components/InstantSearch.js
@@ -1,39 +1,37 @@
-"use strict";
+'use strict';
-function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-exports.InstantSearch = InstantSearch;
-var _react = _interopRequireWildcard(require("react"));
-var _IndexContext = require("../lib/IndexContext");
-var _InstantSearchContext = require("../lib/InstantSearchContext");
-var _useInstantSearchApi = require("../lib/useInstantSearchApi");
-var _excluded = ["children"];
-function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
-function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
-function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
-function InstantSearch(_ref) {
- var children = _ref.children,
- props = _objectWithoutProperties(_ref, _excluded);
- var search = (0, _useInstantSearchApi.useInstantSearchApi)(props);
- if (!search.started) {
+var _object_without_properties = require('@swc/helpers/_/_object_without_properties');
+var React = require('react');
+var IndexContext = require('../lib/IndexContext.js');
+var InstantSearchContext = require('../lib/InstantSearchContext.js');
+var useInstantSearchApi = require('../lib/useInstantSearchApi.js');
+
+function InstantSearch(_0) {
+ var children = _0.children, props = _object_without_properties._(_0, [
+ "children"
+ ]);
+ var search = useInstantSearchApi.useInstantSearchApi(props);
+ if (!search.started) {
+ return null;
+ }
+ return /*#__PURE__*/ React.createElement(InstantSearchContext.InstantSearchContext.Provider, {
+ value: search
+ }, /*#__PURE__*/ React.createElement(IndexContext.IndexContext.Provider, {
+ value: search.mainIndex
+ }, children, /*#__PURE__*/ React.createElement(ResetScheduleSearch, {
+ search: search
+ })));
+}
+function ResetScheduleSearch(param) {
+ var search = param.search;
+ React.useEffect(function() {
+ if (search._resetScheduleSearch) {
+ search._resetScheduleSearch();
+ }
+ }, [
+ search
+ ]);
return null;
- }
- return /*#__PURE__*/_react.default.createElement(_InstantSearchContext.InstantSearchContext.Provider, {
- value: search
- }, /*#__PURE__*/_react.default.createElement(_IndexContext.IndexContext.Provider, {
- value: search.mainIndex
- }, children, /*#__PURE__*/_react.default.createElement(ResetScheduleSearch, {
- search: search
- })));
}
-function ResetScheduleSearch(_ref2) {
- var search = _ref2.search;
- (0, _react.useEffect)(function () {
- if (search._resetScheduleSearch) {
- search._resetScheduleSearch();
- }
- }, [search]);
- return null;
-}
\ No newline at end of file
+
+exports.InstantSearch = InstantSearch;