mysterious-toddler-20573
02/19/2021, 12:33 AMmysterious-toddler-20573
02/19/2021, 12:33 AMmysterious-toddler-20573
02/19/2021, 12:34 AMmysterious-toddler-20573
02/19/2021, 12:34 AMmysterious-toddler-20573
02/19/2021, 5:12 AMmysterious-toddler-20573
02/19/2021, 5:12 AMmysterious-toddler-20573
02/19/2021, 5:37 AMsparse-city-40921
02/19/2021, 7:52 AM* hx-vals is inherited and can be placed on a parent element.
* A child declaration of a variable overrides a parent declaration.
* Input values with the same name will be overridden by variable declarations.sparse-city-40921
02/19/2021, 7:53 AMsparse-city-40921
02/19/2021, 7:54 AMhtml
<!-- GET /article/1 -->
<section>
<h2>Latest Comments</h2>
<div
hx-get="/article/1/comments"
hx-vals='{"after": 0}'
hx-trigger="every 30s"
hx-swap="afterbegin"
></div>
</section>
<!--
...30 seconds pass
GET /article/1/comments?after=0
-->
<p hx-vals='{"after": 5}'>Comment #5</p>
<p>Comment #4</p>
<p>Comment #3</p>
<p>Comment #2</p>
<p>Comment #1</p>
<!--SWAP into html -->
<section>
<h2>Latest Comments</h2>
<div
hx-get="/article/1/comments"
hx-vals='{"after": 0}'
hx-trigger="every 30s"
hx-swap="afterbegin"
>
<p hx-vals='{"after": 5}'>Comment #5</p>
<p>Comment #4</p>
<p>Comment #3</p>
<p>Comment #2</p>
<p>Comment #1</p>
</div>
</section>
<!--
GET ...~30 seconds pass
GET /article/1/comments?after=0
should be after=5 ???
-->sparse-city-40921
02/19/2021, 7:55 AMbig-airline-13935
02/19/2021, 12:11 PMhx-vals is inherited, but the hx-vals child will only work if it has hx-get on it.sparse-city-40921
02/19/2021, 12:14 PMsparse-city-40921
02/19/2021, 12:15 PMbig-airline-13935
02/19/2021, 12:30 PMlocalStorage capacity varies by browser and that there's no way to check how much space is available without filling it up first. I can't think of a better way of limiting it than using the number of pages to cache, in other words how it works right now. Allowing it to fill to capacity (5MB on Chrome) doesn't seem like a very sensible thing to do.big-airline-13935
02/19/2021, 12:30 PMmysterious-toddler-20573
02/19/2021, 5:20 PMmysterious-toddler-20573
02/19/2021, 5:20 PMmysterious-toddler-20573
02/19/2021, 5:21 PMsparse-musician-64201
02/19/2021, 7:01 PMsparse-musician-64201
02/19/2021, 7:04 PMsparse-musician-64201
02/19/2021, 7:06 PMmysterious-toddler-20573
02/19/2021, 7:06 PMmysterious-toddler-20573
02/19/2021, 7:06 PMmysterious-toddler-20573
02/19/2021, 7:06 PMmysterious-toddler-20573
02/19/2021, 7:07 PMmysterious-toddler-20573
02/19/2021, 7:07 PMsparse-musician-64201
02/19/2021, 7:08 PMsparse-musician-64201
02/19/2021, 7:08 PMsparse-musician-64201
02/19/2021, 7:09 PM