-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
edge cases on the web-- who woulda thought!?
- Loading branch information
1 parent
0490757
commit 304f476
Showing
7 changed files
with
76 additions
and
241 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>TakeWhile Demo</title> | ||
<style> | ||
.highlight { | ||
background-color: yellow; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<span>1</span> | ||
<span>2</span> | ||
<span>3</span> | ||
<span>4</span> | ||
<span>5</span> | ||
<span>6</span> | ||
<span>7</span> | ||
|
||
<script type="module"> | ||
import { $$, $ } from "../index.js" | ||
|
||
const elems = $$("span") | ||
.if({ | ||
is: (el) => parseInt(el.textContent) % 2 === 0, | ||
then: (el) => el.css("background-color", "yellow"), | ||
or: (el) => el.css("background-color", "pink"), | ||
}) | ||
.css("border", "2px solid black") | ||
.do((el) => console.log(el.textContent)) | ||
</script> | ||
</body> | ||
</html> |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Wrapped Fetch Test</title> | ||
</head> | ||
<body> | ||
<div id="target">Data will appear here...</div> | ||
|
||
<button>Fetch Data</button> | ||
|
||
<script type="module"> | ||
import { $, $$ } from "../index.js" | ||
const target = $("#target") | ||
|
||
$("button").on("click", () => { | ||
$("button").send({ | ||
url: "http://localhost:3000/data", | ||
onWait: () => target.text("Fetching..."), | ||
onSuccess: (data) => target.text(`Data: ${data}`), | ||
onError: (error) => target.text(`Error: ${error}`), | ||
retries: 5, | ||
retryDelay: 1000, | ||
waitTime: 500, | ||
method: "GET", | ||
body: "This will get ignored on GET/HEAD requests", | ||
}) | ||
}) | ||
</script> | ||
</body> | ||
</html> |
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