@wordpress/data
Version:
Data module for WordPress.
18 lines (17 loc) • 674 B
JavaScript
// packages/data/src/components/with-select/index.js
import { createHigherOrderComponent, pure } from "@wordpress/compose";
import useSelect from "../use-select";
import { jsx } from "react/jsx-runtime";
var withSelect = (mapSelectToProps) => createHigherOrderComponent(
(WrappedComponent) => pure((ownProps) => {
const mapSelect = (select, registry) => mapSelectToProps(select, ownProps, registry);
const mergeProps = useSelect(mapSelect);
return /* @__PURE__ */ jsx(WrappedComponent, { ...ownProps, ...mergeProps });
}),
"withSelect"
);
var with_select_default = withSelect;
export {
with_select_default as default
};
//# sourceMappingURL=index.js.map