Skip to content

Commit

Permalink
Document pageFilter and PageSelector usage
Browse files Browse the repository at this point in the history
Adding jsdoc comments allows for easier usage of both in the IDE.
  • Loading branch information
bjoernricks committed Jan 15, 2025
1 parent 30401d5 commit baeba3b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/web/store/pages/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@

export const CHANGE_PAGE_FILTER = 'CHANGE_PAGE_FILTER';

/**
* Action creator to set a filter for a page
*
* @param {String} page
* @param {Filter} filter
* @returns A dispatchable action
*/
export const pageFilter = (page, filter) => ({
type: CHANGE_PAGE_FILTER,
page,
Expand Down
6 changes: 6 additions & 0 deletions src/web/store/pages/selectors.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ class PageSelector {
}
}

/**
* Get a PageSelector from the root state
*
* @param {Object} rootState
* @returns {PageSelector} A PageSelector instance
*/
const getPage = (rootState = {}) => new PageSelector(rootState.pages);

export default getPage;

0 comments on commit baeba3b

Please sign in to comment.