Skip to content

Commit

Permalink
Add comments to exported members of utils.js
Browse files Browse the repository at this point in the history
  • Loading branch information
adamziel committed Jun 22, 2020
1 parent c82b617 commit 27eac24
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions packages/edit-navigation/src/store/utils.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,32 @@
/**
* "Kind" of the navigation post.
*
* @type {string}
*/
export const KIND = 'root';

/**
* "post type" of the navigation post.
*
* @type {string}
*/
export const POST_TYPE = 'postType';

/**
* Builds an ID for a new navigation post.
*
* @param {number} menuId Menu id.
* @return {string} An ID.
*/
export const buildNavigationPostId = ( menuId ) =>
`navigation-post-${ menuId }`;

/**
* Builds a query to resolve menu items.
*
* @param {number} menuId Menu id.
* @return {Object} Query.
*/
export function menuItemsQuery( menuId ) {
return { menus: menuId, per_page: -1 };
}

0 comments on commit 27eac24

Please sign in to comment.