Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: allow filter overlay message with function
- Loading branch information
1 parent
ee748a7
commit 4658fde
Showing
10 changed files
with
432 additions
and
186 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,24 @@ | ||
"use strict"; | ||
|
||
function unsafeOperation() { | ||
throw new Error("Error message thrown from JS"); | ||
} | ||
/** | ||
* | ||
* @param {string} label | ||
* @param {string} errorMessage | ||
* @returns HTMLButtonElement | ||
*/ | ||
module.exports = function createErrorButton(label, errorMessage) { | ||
function unsafeOperation() { | ||
throw new Error(errorMessage); | ||
} | ||
|
||
function handleButtonClick() { | ||
unsafeOperation(); | ||
} | ||
function handleButtonClick() { | ||
unsafeOperation(); | ||
} | ||
|
||
module.exports = function createErrorButton() { | ||
const errorBtn = document.createElement("button"); | ||
|
||
errorBtn.addEventListener("click", handleButtonClick); | ||
errorBtn.innerHTML = "Click to throw error"; | ||
errorBtn.innerHTML = label; | ||
|
||
return errorBtn; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.