Code Monkey home page Code Monkey logo

react-server-clientside_state-grokk's Introduction

Server-side <-> Client-side state management & synchronization.

Description of the project

In this repository I grokked TanStack Query (A.K.A React Query) in the main branch before deciding to move on to Redux Toolkit & Redux Toolkit Query.

Branches

Main branch: React Query implementation Redux branch: Redux Toolkit & RTK Query implementation

Both branches are based around the exact same ui and logic (may be some slight differences but the project is essentially the same). I.e it is the same application but with two different approaches to managing client-side state and the synchronization of client-side state with server-side state.


The case for React Query

The idea of the repository was to grokk react query a little since it is a very widely used async client-side <-> server-side synchronization library that handles various scenarios (retries, automatic refetch, caching etc.) with it's implemented mechanisms.

This will by no means be a large or even medium sized project. I will simply play around a bit here while learning react-query on a deeper level to be able to use it in enterprise scale codebases.

Completed (React Query):

  • Car list
    • Fetch and cache
      (refetch on page change, I'm using idiomatic next routing but still couldn't get query to cooperate. Didn't give it my all but tried some tips)
    • Invalidate upon uploading new car (leads to refetch of the car list)
  • Last selected
    • Selecting car will first send a patch to update the selected car and then invalidate the current selected car and trigger a refetch.
  • Brand list
    • Paginated requests
    • Prefetch (Had a working prefetch example I worked with but didn't implement)
    • Didn't manage to cache pages on this project but I played aroudn with a smaller code base where I managed to do this and prefetch also.

react-server-clientside_state-grokk's People

Contributors

noricane avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.