Coder Social home page Coder Social logo

optimistic-updates-demo's Introduction

Netlify Status


Logo

Optimistic Updates Demo

Example using Lerna to manage a monorepo that contains a database, component library, client and api service
View Demo · Report Bug · Request Feature

Table of Contents

  1. About The Project
  2. Getting Started
  3. Usage
  4. Contact

About The Project

Optimistic Updates Demo Screenshot

An example repo created to demonstrate optimistic updates in Apollo Client and SWR. It includes:

  • A simple component library created with Material UI, with a custom theme
  • A local Apollo Client resolver set that simulates server responses
  • A local SWR resolver set that simulates server responses (in progress)

Built With

Getting Started

  1. Clone the repo

    git clone https://github.com/SkelleyBelly/optimistic-updates-demo
  2. Install root dependencies (via Yarn or NPM)

    npm install
    
    or
    
    yarn install
  3. Start the development server

    npm run start
    
    or
    
    yarn start

Usage

Adjust the controls to change how delays, optimistic responses and errors are applied to the application:

  • Optimistic: Switch on optimistic responses that update the cached data on the client before the server response has been returned. This provides immediate feedback and a more responsive feel to the application.

  • Delay: Delay the server response by 1500ms. By default, the mock server will respond immediately

  • Force Error: Make the mock server return errors. This can be used to demonstrate how delayed errors interact with optimistic responses to clear out the locally updated data.

Contact

Nathan Skelley - website

Project Link: https://github.com/SkelleyBelly/optimistic-updates-demo

optimistic-updates-demo's People

Contributors

skelleybelly avatar

Watchers

James Cloos avatar  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.