JavaScript Pagination in ~10 Minutes (Super EASY!!)

  Рет қаралды 32,491

James Q Quick

James Q Quick

Күн бұрын

Пікірлер: 37
@melodium10
@melodium10 Жыл бұрын
The perfect explanation doesn't exi- but i thought that pagination is something where there are buttons 1, 2, 3 til the end and u click one of them and go to a page. never thought it was a single page thing too
@JamesQQuick
@JamesQQuick Жыл бұрын
Pagination takes several different forms all with different use cases!
@soniablanche5672
@soniablanche5672 Жыл бұрын
skip/limit is pretty bad if you have a lot of rows. The database is actually iterating through all the items until it reaches the last item to skip. It's better to have some sort of index to use as a reference and fetch only the rows that have an index bigger than the reference index + limit
@marcoio8742
@marcoio8742 Жыл бұрын
Totally agree with you. Especially, nowadays with db that charge per usage like PlanetScale where you are billed per row read and written. Going up with the items, you end up reading a 1000 rows to then return 100 (that's a weird way SQL works honestly). Personally, I am using a method that I read somewhere which is working pretty nicely. You keep the limit to decide the size of the page, and then you receive the last id and when you fetch you use that as a start so you never read more than the number of rows you actually need
@JamesQQuick
@JamesQQuick Жыл бұрын
Great point. It goes beyond the basics as covered in this video, but something worth calling out
@charlesscholton5252
@charlesscholton5252 7 ай бұрын
​@@JamesQQuickI think the introduction of these advanced concepts early on to people will help them understand how important it is. I know I had to learn the hard way from following simple examples that kept me in the dark. It is a very frustrating experience for people to go through.
@gioba4912
@gioba4912 Жыл бұрын
With was an awesome in a myriads of ways. - Presentation - clarity - pace - etc! Thank you!
@JamesQQuick
@JamesQQuick Жыл бұрын
WOW! Thank you so much :)
@Joe-SoftwareEngineer
@Joe-SoftwareEngineer Жыл бұрын
For the 1st kind of pagination that you mentioned, why not just pass the page number instead of the skip and calculate the skip server-side?
@JamesQQuick
@JamesQQuick Жыл бұрын
It gives more flexibility to the frontend if the backend accepts both. Different apps may decide to display more/less items at a time. BUT using page number could definitely work!
@PJlikePajamas
@PJlikePajamas Жыл бұрын
Love it! I’ll be looking forward to learning more about Astro in September!🤘🤘
@JamesQQuick
@JamesQQuick Жыл бұрын
YAYYY!! It's getting close!
@PJlikePajamas
@PJlikePajamas Жыл бұрын
@@JamesQQuick I’ve been reading through the docs today so I’m at least somewhat familiar. Looks awesome, can’t wait to see it in action!
@CreativeTutorialsWeb
@CreativeTutorialsWeb Жыл бұрын
Always always always love your content James. Great work
@JamesQQuick
@JamesQQuick Жыл бұрын
Thanks so much. really appreciate it :)
@maxzapom
@maxzapom 4 ай бұрын
This was very interesting thanks
@derekbaker_
@derekbaker_ Жыл бұрын
This was perfect. Thank you
@JamesQQuick
@JamesQQuick Жыл бұрын
So glad you enjoyed it!
@AndreSpecht
@AndreSpecht Жыл бұрын
Amazing. Do you have a tutorial for a blog with React and Firebase (or other DB)?
@89tain
@89tain Жыл бұрын
This is really nice man
@JamesQQuick
@JamesQQuick Жыл бұрын
So glad you think so@
@codegenesis2130
@codegenesis2130 9 ай бұрын
what is the vs code theme you are using?? please mention
@rajajunaidf
@rajajunaidf Жыл бұрын
Which VS Code theme are you using?
@JamesQQuick
@JamesQQuick Жыл бұрын
This is my own theme - James Q Quick :)
@rajajunaidf
@rajajunaidf Жыл бұрын
That's Cool 🔥🔥🔥@@JamesQQuick
@gliderguld
@gliderguld Жыл бұрын
How about cursorbased 0:44 pagination? And 'infinitive' data like dates.
@simoid6246
@simoid6246 7 ай бұрын
but what if the url not have limit and skip query
@la009895
@la009895 Жыл бұрын
For your Astro course, if you include how to deploy it to prod. Aka the web, I will buy it. I can get projects to run locally but as soon as it’s time to deploy I get lost.
@JamesQQuick
@JamesQQuick Жыл бұрын
Definitely will include publishing to prod!
@defaultname5607
@defaultname5607 7 ай бұрын
c'est pas plus facile getjson => create tab => read 10 first elements ?
@HowManyShrimps-g7z
@HowManyShrimps-g7z Жыл бұрын
James, how much money Astro pays for your ad?
@JamesQQuick
@JamesQQuick Жыл бұрын
None at all :) Thanks for clarifying that!
@蹦太君-o4d
@蹦太君-o4d Жыл бұрын
thanks >
@jasonwelsh417
@jasonwelsh417 Жыл бұрын
You can tell this guy has never worked on a production database before
@JamesQQuick
@JamesQQuick Жыл бұрын
Lol why is that?
@jasonwelsh417
@jasonwelsh417 Жыл бұрын
@@JamesQQuick Your example would have the database iterating until the last row instead of utilizing an index. If you have a large database this is a bad idea.
@charlesscholton5252
@charlesscholton5252 7 ай бұрын
​@@jasonwelsh417 sshhh.. you are revealing too much arcane secret knowledge. I make jokes about how much of these things work great until the database grows or when encountering and dealing with large amounts of data.
5 JavaScript Concepts You HAVE TO KNOW
9:38
James Q Quick
Рет қаралды 1,4 МЛН
Learn CSS pagination in 8 minutes! 🕮
8:59
Bro Code
Рет қаралды 28 М.
Why no RONALDO?! 🤔⚽️
00:28
Celine Dept
Рет қаралды 89 МЛН
The Ultimate Sausage Prank! Watch Their Reactions 😂🌭 #Unexpected
00:17
La La Life Shorts
Рет қаралды 8 МЛН
Yay😃 Let's make a Cute Handbag for me 👜 #diycrafts #shorts
00:33
LearnToon - Learn & Play
Рет қаралды 117 МЛН
Create A Paginated API With Node.js - Complete Tutorial
23:21
Web Dev Simplified
Рет қаралды 197 М.
JavaScript Visualized - Event Loop, Web APIs, (Micro)task Queue
12:35
Each Media Query in CSS You MUST Know
4:47
IFace
Рет қаралды 760
My New Favorite Pagination Method
5:45
Josh tried coding
Рет қаралды 89 М.
Front-End Pagination using JavaScript
17:53
Lun Dev
Рет қаралды 20 М.
Tips and Tricks for Debugging JavaScript
13:03
James Q Quick
Рет қаралды 415 М.
CSS Anchor Is The Best New CSS Feature Since Flexbox
15:39
Web Dev Simplified
Рет қаралды 375 М.
Subtle, yet Beautiful Scroll Animations
5:04
Beyond Fireship
Рет қаралды 1,8 МЛН
Pagination in JavaScript
28:27
Tyler Potts
Рет қаралды 94 М.
Why no RONALDO?! 🤔⚽️
00:28
Celine Dept
Рет қаралды 89 МЛН