Video yükleniyor...

Video Yüklenemedi

Ana Sayfaya Dön

How should you search, filter, and paginate data with Next.js? This demo has 50,000 books in a Postgres database. • Page Load: When the page loads, we see the React Suspense fallback. This loading skeleton is displayed until the first page of books is retrieved from the database. •...

236,802 görüntüleme • 2 yıl önce •via X (Twitter)

10 Yorum

codeagencybe profil fotoğrafı
codeagencybe2 yıl önce

1. Cache results with (redis Alternative) to avoid re-query same data over and over 2. Use to index results for blazing fast filtering and fuzzy searching

Lee Robinson profil fotoğrafı
Lee Robinson2 yıl önce

If you're trying to avoid re-querying, you can use the built-in React cache() function.

Shubham Saurabh profil fotoğrafı
Shubham Saurabh2 yıl önce

Nice demo Lee! By changing page=-1 in params, it’s throwing some error saying “database does not have a books table”.

Lee Robinson profil fotoğrafı
Lee Robinson2 yıl önce

You're hired for the QA team 🤣

obnol profil fotoğrafı
obnol2 yıl önce

looks like the `[id]` page cant be found, try to refresh on the page directly

Lee Robinson profil fotoğrafı
Lee Robinson2 yıl önce

Nice, good catch. Let me fix this.

codeagencybe profil fotoğrafı
codeagencybe2 yıl önce

Here's An example with typesense with 28 millions books:

Rob Funcken profil fotoğrafı
Rob Funcken2 yıl önce

Nice work Lee. I’m working on a feature that needs this and will look at your implementation for inspiration. I saw that the pagination bar is not showing up on iOS, maybe something with vheight?

Lee Robinson profil fotoğrafı
Lee Robinson2 yıl önce

Ahhh yes, if you scroll futher it's there. It's the Safari viewport differences, I will fix.

Joel Hooks profil fotoğrafı
Joel Hooks2 yıl önce

love seeing the examples Lee. it's a huge help.

Benzer Videolar

Hamas leader Khaled Mashal: “We do not accept the two state solution.” — January 22, 2024 “I would like to say two things about the two-state solution. First, we have nothing to do with the two-state solution. We reject this notion, because it means you would get a promise for a [Palestinian] state, yet you are required to recognize the legitimacy of the other state, which is the Zionist entity. This is unacceptable. We demand to be liberated, to get rid of the occupation, and to have our independence, and our state. [Israel] is my enemy. It is not my concern." “Obviously, the position of Hamas, and the position of the vast majority of the Palestinian people, especially following October 7, I believe that the dream and the hope for Palestine from the River to the Sea, and from the north to the south, has been renewed. This has also become a slogan chanted in the U.S., and in western capital cities, by the American and Western public.” “Hamas agreed to a completely independent (Palestinian) state, with the 1967 borders, with Jerusalem as its capital, with the Right of Return included without recognizing the legitimacy of the Zionist entity. This position was meant to facilitate Palestinian and Arab agreement at this stage, but without relinquishing any of our rights or any part of our land, and without recognizing Israel. Our vision remains unchanged. I believe that October 7 has enhanced this conviction, has narrowed the disagreements, and has turned the idea of liberating Palestine from the River to the Sea into a realistic idea that has already begun. It is not something merely to be expected or hoped for, It is part of the plan, part of the agenda, and we are standing on its threshold, Allah willing.” TRANSLATED BY MEMRI Source:

dan linnaeus

96,479 görüntüleme • 2 yıl önce

The House of Reps has passed second reading of a constitutional amendment bill to remove immunity from the Vice President, the Governors, and their Deputies in order to curb corruption, eradicate impunity, and enhance accountability in public office, along with 41 other bills. The others bill are: A Bill for a Creating Additional Three States Oke - Ogun State, ljebu State and Ife - ljesa State. A Bill for the Creation of "Tiga State" from the Present Kano State with Headquarters in "Rano". A bill to Create a New State in the South Eastern Region of Nigeria Known as Orlu State. A bill to Create an Additional State in the South East Region of Nigeria, Carved from the Existing Five (5) States to be known as Etiti State with Capital at Okigwe. A Bill to Establish and Provide Roles for Traditional Rulers in Nigeria and Provide for the Recognition of the Advisory Role of Traditional Rulers in the Constitution. A bill to Grant Citizenship Rights to Spouses of Women from Nigeria, Specify the Minimum Number of Youths and Women that May be Appointed into Specific Offices. A bill to Guarantee Indigene Status to Persons by Reason of Birth or Continued Residence for a Period of Not Less than Ten Years or by Reason of Marriage. A bill to include Citizenship by Investment as one of the classes of Citizenship in Nigeria, provides for the Acquisition of Nigerian Citizenship by Qualified Foreign Investors who meet Specified Investment Thresholds. A bill to Separate the Offices of the Attorney-General of the Federation, Attorney-General of a State from the Offices of the Minister of Justice of the Federal Government and Commissioner for Justice of the Government of a State. A bill to Provide for the Establishment of the Office of the Accountant-General of the Federation and the Office of the Accountant-General of the Federal Government. A bill to Increase the Number of Members of the Federal Civil Service Commission to Provide for each State of the Federation and Federal Capital Territory, Abuja the Opportunity of One Person Representation. A bill to Mandate all Government Statutory Corporations, Commissions, Authorities, Agencies including all Persons and Bodies Established by Law to Submit Yearly Financial Statement to the Auditor General within a Specified Period. A bill to Specify the Period for the Laying of Annual Budget Estimates Before the National and State Houses of Assembly. A bill to Provide for the Public Disclosure of Reports of the Auditor-General of the Federation and for the Auditor-General of a State. And others constitutional amendments.

Imran Muhammad

116,014 görüntüleme • 1 yıl önce