Skip to content

Commit 0a6db53

Browse files
committed
refactor(guess-the-word): use config as parameter name instead of extraParams
1 parent 2bbfa53 commit 0a6db53

File tree

4 files changed

+16
-16
lines changed

4 files changed

+16
-16
lines changed

vanilla/guess-the-word/src/pages.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -52,18 +52,18 @@ export class Pages {
5252

5353
/**
5454
* @param {HTMLDivElement} $pagesContainer
55-
* @param {Object} extraParams
56-
* @param {Item[]} [extraParams.items]
57-
* @param {number} extraParams.itemsPerPage
58-
* @param {ItemRenderer<Item>} extraParams.renderItem
55+
* @param {Object} config
56+
* @param {Item[]} [config.items]
57+
* @param {number} config.itemsPerPage
58+
* @param {ItemRenderer<Item>} config.renderItem
5959
* Must return an `HTMLLIElement` or a `DocumentFragment` whose first child is
6060
* an `HTMLLIElement`
61-
* @param {($page: HTMLUListElement) => void} extraParams.clearEmpty
62-
* @param {(removedItem: Item) => void} [extraParams.onItemRemoved]
61+
* @param {($page: HTMLUListElement) => void} config.clearEmpty
62+
* @param {(removedItem: Item) => void} [config.onItemRemoved]
6363
* Triggered when an element of an item is removed from a page
64-
* @param {($page: HTMLUListElement) => void} [extraParams.onPageChange]
65-
* @param {HTMLTemplateElement} extraParams.$pageTemplate
66-
* @param {HTMLTemplateElement} extraParams.$pageEmptyTemplate
64+
* @param {($page: HTMLUListElement) => void} [config.onPageChange]
65+
* @param {HTMLTemplateElement} config.$pageTemplate
66+
* @param {HTMLTemplateElement} config.$pageEmptyTemplate
6767
*/
6868
constructor(
6969
$pagesContainer,

vanilla/guess-the-word/src/pagination.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ export class Pagination {
1515

1616
/**
1717
* @param {HTMLMenuElement} $pagination
18-
* @param {Object} extraParams
19-
* @param {import("./pages").Pages<any>} extraParams.pagesHandler
20-
* @param {boolean} [extraParams.renderCurrent]
18+
* @param {Object} config
19+
* @param {import("./pages").Pages<any>} config.pagesHandler
20+
* @param {boolean} [config.renderCurrent]
2121
* Whether to call `pagesHandler.renderPage(currentPage)` on initialization
2222
*/
2323
constructor($pagination, { pagesHandler, renderCurrent = true }) {

vanilla/guess-the-word/src/services/saved-words/add.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { DIFFICULTIES_ALL } from "@/consts/difficulty";
44
import { DISCOVERED_WORDS } from "@/consts/discovered-words";
55

66
/** @param {string} word
7-
* @param {{ difficulty: import("@/consts/difficulty").Difficulty }} extraParams
7+
* @param {{ difficulty: import("@/consts/difficulty").Difficulty }} config
88
* @returns {{ completed: boolean }} */
99
export const addDiscoveredWord = (word, { difficulty }) => {
1010
const availableDifficulties = getDifficultiesOfWord(word);

vanilla/guess-the-word/src/state/words.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ export const setWordsByDifficulty = async (difficulty) => {
3131
};
3232

3333
/** @param {string} word
34-
* @param {Object} extraParams
35-
* @param {import("@/consts/difficulty").Difficulty} extraParams.difficulty
36-
* @param {boolean} [extraParams.isInitialization] */
34+
* @param {Object} config
35+
* @param {import("@/consts/difficulty").Difficulty} config.difficulty
36+
* @param {boolean} [config.isInitialization] */
3737
export const removeAvailableWord = async (
3838
word,
3939
{ difficulty, isInitialization = false },

0 commit comments

Comments
 (0)