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 f7b1747
Showing
9 changed files
with
408 additions
and
182 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.