"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = useSlot;
var _element = require("@wordpress/element");
var _compose = require("@wordpress/compose");
var _slotFillContext = _interopRequireDefault(require("./slot-fill-context"));
/**
 * WordPress dependencies
 */

/**
 * Internal dependencies
 */

function useSlot(name) {
  const registry = (0, _element.useContext)(_slotFillContext.default);
  const slot = (0, _compose.useObservableValue)(registry.slots, name);
  return {
    ...slot
  };
}
//# sourceMappingURL=use-slot.js.map