All Projects → tannerlinsley → react-query-blog-demo

tannerlinsley / react-query-blog-demo

Licence: other
An example repo I used to teach a React Query workshop

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to react-query-blog-demo

wsdm-digg-2020
No description or website provided.
Stars: ✭ 15 (-81.71%)
Mutual labels:  workshop
react-vite-admin
This Starter utilizes React, Recoil, React Query, React Hooks, Typescript, Axios And Vite. 全新技术栈的后台管理系统
Stars: ✭ 90 (+9.76%)
Mutual labels:  react-query
ws-ldn-12
ARM / STM32F7 DIY synth workshop
Stars: ✭ 62 (-24.39%)
Mutual labels:  workshop
fx-trading-app
Forex Trading Application workshop
Stars: ✭ 23 (-71.95%)
Mutual labels:  workshop
CFP
Repositório para sugestões de palestras, workshops e outras atividades da comunidade PHPRio
Stars: ✭ 39 (-52.44%)
Mutual labels:  workshop
workshop-init
워크숍 개발 환경 설정하기
Stars: ✭ 23 (-71.95%)
Mutual labels:  workshop
Machine-Learning-in-Python-Workshop
My workshop on machine learning using python language to implement different algorithms
Stars: ✭ 89 (+8.54%)
Mutual labels:  workshop
gSynch
gSynch allows you to synchronise your Git repository with your Steam Workshop publication in few clicks.
Stars: ✭ 28 (-65.85%)
Mutual labels:  workshop
Not-a-Dog-Workshop
Workshop to build an automatic Not a Dog application , using the Serverless Azure Functions and Cognitive Services
Stars: ✭ 15 (-81.71%)
Mutual labels:  workshop
JavaFXWorkshop
Code and a handout for a JavaFX workshop
Stars: ✭ 24 (-70.73%)
Mutual labels:  workshop
godge
Godge is a self-hosted container-based online judge for meetups and workshops.
Stars: ✭ 13 (-84.15%)
Mutual labels:  workshop
ultimate-kubernetes-bootcamp
Ultimate Kubernetes Bootcamp
Stars: ✭ 43 (-47.56%)
Mutual labels:  workshop
spring-cloud-gcp-guestbook
No description or website provided.
Stars: ✭ 55 (-32.93%)
Mutual labels:  workshop
angular2-labb
Angular 2 workshop
Stars: ✭ 20 (-75.61%)
Mutual labels:  workshop
amsterdamjs-clojurescript-workshop
Educational materials for ClojureScript workshop @ AmsterdamJS '18
Stars: ✭ 28 (-65.85%)
Mutual labels:  workshop
Bot-Framework-Tutorial
Microsoft Bot Framework Hands on Lab Tutorial
Stars: ✭ 23 (-71.95%)
Mutual labels:  workshop
DscWorkshop
Blueprint for a full featured DSC project for Push / Pull with or without CI/CD
Stars: ✭ 151 (+84.15%)
Mutual labels:  workshop
ML-CM-2019
Machine Learning in Condensed Matter Physics 2019 course repository
Stars: ✭ 51 (-37.8%)
Mutual labels:  workshop
VFX-Essentials
VFX graph workshop in HDRP with samples
Stars: ✭ 122 (+48.78%)
Mutual labels:  workshop
AzureFunctions-Workshop
Multi-language Azure Functions Workshop
Stars: ✭ 20 (-75.61%)
Mutual labels:  workshop

What is this?

It's an example repo that show show to go from a simple hook-based application to React Query, avoiding all of the "global state" madness that normally happens!

  • The main branch contains the initial code we started with
  • The with-react-query branch contains the code we ended with after adding react-query
  • The #2 PR currently open in the repo shows the changes between the two

Challenges

  • Convert the custom hooks used to fetch data to use useQuery
  • Implement per-screen background fetching indicators
  • Convert the custom hooks used to create/update/delete to use useMutation
  • Configure mutations to automatically invalidate related queries
  • Implement optimistic updates for mutations
  • Prefetch individual posts on hover using queryCache.prefetchQuery OR
  • Use initialData to show placeholder content for individual posts that pull from the parent posts query
  • Remove per-screen background fetching indicators and instead build a global refetching indicator
  • Dehydrate/hydrate the cache to and from localStorage using the react-query/hydration APIs

How do I develop on this?

  • Run yarn and then yarn dev locally.
  • Open http://localhost:3000 with your browser to see the result.
  • NOTE: The "database" used in this app is simply a JSON file and thus will not work as a deployed application. That said, you are more than welcome to hook it up to a real API if you want!

Why Next.js?

Read This 😁

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].