/* wp:polyfill */
/**
 * WordPress dependencies
 */
import { useRegistry, useDispatch } from '@wordpress/data';
import { useEffect } from '@wordpress/element';

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