From baeba3b88ded7b3cb2d7488be947dae14834db83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Ricks?= Date: Wed, 15 Jan 2025 11:23:09 +0100 Subject: [PATCH] Document pageFilter and PageSelector usage Adding jsdoc comments allows for easier usage of both in the IDE. --- src/web/store/pages/actions.js | 7 +++++++ src/web/store/pages/selectors.js | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/src/web/store/pages/actions.js b/src/web/store/pages/actions.js index 05f5802a49..432e057195 100644 --- a/src/web/store/pages/actions.js +++ b/src/web/store/pages/actions.js @@ -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, diff --git a/src/web/store/pages/selectors.js b/src/web/store/pages/selectors.js index d512d5ef22..4cd0fa7347 100644 --- a/src/web/store/pages/selectors.js +++ b/src/web/store/pages/selectors.js @@ -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;