Skip to content

Commit

Permalink
infinite_scroll ok
Browse files Browse the repository at this point in the history
  • Loading branch information
librasteve committed Nov 20, 2024
1 parent 56fc479 commit 5dabd51
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 15 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Candidates for Fragments are:
- [x] click_to_load - 1
- [x] edit_row - 1
- [x] inline_validation
- [ ] infinite_scroll
- [x] infinite_scroll
- [ ] value_select
- [ ] tabs_hateos
- [ ] tabs_hyperscript
Expand Down
2 changes: 1 addition & 1 deletion lib/Routes/Examples/Infinite-Scroll.rakumod
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ sub infinite_scroll-routes() is export {

get -> 'contacts', Int :$page! {
sleep 1; #<= delay to make spinner visible
template 'partial.crotmp', {contacts=>gen-contacts($page), next=>($page+1)};
template 'index.crotmp', :fragment<partial>, {contacts=>gen-contacts($page), next=>($page+1)};
}
}
}
2 changes: 2 additions & 0 deletions templates/infinite_scroll/index.crotmp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
</tr>
</thead>
<tbody id="tbody">
<:fragment partial($_)>
<@contacts : $c>
<?$c.last>
<tr hx-get="/infinite_scroll/contacts?page=<.next>" hx-trigger="revealed" hx-swap="afterend" hx-target="this">
Expand All @@ -19,6 +20,7 @@
<td><$c.id></td>
</tr>
</@>
</:>
</tbody>
</table>
<img id="ind" src="/img/bars.svg" width="150" class="htmx-indicator" />
12 changes: 0 additions & 12 deletions templates/infinite_scroll/partial.crotmp

This file was deleted.

2 changes: 1 addition & 1 deletion templates/inline_validation/index.crotmp
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@
</div>
<button>Submit</button>
</form>
</div>
</div>

0 comments on commit 5dabd51

Please sign in to comment.