Skip to content

Commit

Permalink
fix: do not reassign parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisfalaska committed Oct 30, 2024
1 parent dabec23 commit 774e0f8
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions components/dropdown/demo/api.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,18 @@
/* eslint-disable jsdoc/require-jsdoc, no-magic-numbers, no-param-reassign */

/* eslint-disable jsdoc/require-jsdoc, no-magic-numbers */
import { showExample } from './../apiExamples/programmaticallyShow.js';
import { hideExample } from './../apiExamples/programmaticallyHide.js';

export function initExamples(initCount) {
initCount = initCount || 0;

export function initExamples(initialCount = 0) {
try {
// javascript example function calls to be added here upon creation to test examples
showExample();
hideExample();
} catch (err) {
if (initCount <= 20) {
if (initialCount <= 20) {
// setTimeout handles issue where content is sometimes loaded after the functions get called
setTimeout(() => {
initExamples(initCount + 1);
initExamples(initialCount + 1);
}, 100);
}
}
}

}

0 comments on commit 774e0f8

Please sign in to comment.