import { useRegistry, useDispatch } from "@wordpress/data";
import { useEffect } from "@wordpress/element";
import { unlock } from "../../lock-unlock";
import { store as siteEditorStore } from "../../store";
import { postsRoute } from "./posts";
import { postItemRoute } from "./post-item";
const routes = [postItemRoute, postsRoute];
function useRegisterPostsAppRoutes() {
  const registry = useRegistry();
  const { registerRoute } = unlock(useDispatch(siteEditorStore));
  useEffect(() => {
    registry.batch(() => {
      routes.forEach(registerRoute);
    });
  }, [registry, registerRoute]);
}
export {
  useRegisterPostsAppRoutes
};
//# sourceMappingURL=index.js.map
