/* wp:polyfill */
"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.useRegisterPostsAppRoutes = useRegisterPostsAppRoutes;
var _data = require("@wordpress/data");
var _element = require("@wordpress/element");
var _lockUnlock = require("../../lock-unlock");
var _store = require("../../store");
var _posts = require("./posts");
var _postItem = require("./post-item");
/**
 * WordPress dependencies
 */

/**
 * Internal dependencies
 */

const routes = [_postItem.postItemRoute, _posts.postsRoute];
function useRegisterPostsAppRoutes() {
  const registry = (0, _data.useRegistry)();
  const {
    registerRoute
  } = (0, _lockUnlock.unlock)((0, _data.useDispatch)(_store.store));
  (0, _element.useEffect)(() => {
    registry.batch(() => {
      routes.forEach(registerRoute);
    });
  }, [registry, registerRoute]);
}
//# sourceMappingURL=index.js.map