Questions tagged [optimistic-ui]

Optimistic UIs don’t wait for an operation to finish to update to the final state. They immediately switch to the final state, showing fake data for the time while the real operation is still in-progress.

In an optimistic update the UI behaves as though a change was successfully completed before receiving confirmation from the server that it actually was - it is being optimistic that it will eventually get the confirmation rather than an error. This allows for a more responsive user experience.

26 questions
1
vote
1 answer

Meteor, how to update collection with optimistic UI

in my app I placed the methods in a shared location between client and server. this way as suggested in meteor docs the method mechanism takes care of optimistic UI. but I just read in the David Weldon blog about two-tier implementation and it makes…
koolaang
  • 397
  • 6
  • 15
1
vote
1 answer

How does Meteor handle dependent failed optimistics operations?

How does Meteor's optimistic UI handle server rejections and errors on dependent operations? If I do : var item1Id = Items.insert({list: groceriesId, name: "Watercress"}); // op1 var item = Items.findOne({_id: item1Id}); Items.update(item, {$set:…
opsb
  • 29,325
  • 19
  • 89
  • 99
0
votes
1 answer

tRPC setData hook doesn't have access to all data for optimistic ui updates

I'm building out mutations with tRPC and React Query that optimistically update my UI when a new item is added, but I'm running into a problem. The query that I'm updating expects a certain number of properties that are either auto-generated, such…
Jesse Winton
  • 568
  • 10
  • 33
0
votes
1 answer

React - Struggling with optimistic UI when deleting an item

I'm struggling to get a mini project of mine to optimistically render when a user tries to delete a comment of their own. Currently the array of comments is coming down on props from a parent component, and before that is from the backend. I'm…
0
votes
0 answers

losing my mind - why doesn't my fetch re render (redux)

In my project I have many users and many resources (and many user_resources/the join between users and resources).When I POST to user_resources I see it work on my rails backend (as in I see that instance posted) but in my react native front end I…
st123
  • 246
  • 3
  • 14
0
votes
1 answer

optimisticResponse not working for useMutation hook using React Apollo

I'm using the latest Apollo Hooks (v3.1.1) My code looks like - import { ApolloProvider, useMutation, useQuery } from '@apollo/react-hooks' import ApolloClient, { gql } from 'apollo-boost' import React from 'react' const client = new…
deadcoder0904
  • 7,232
  • 12
  • 66
  • 163
0
votes
0 answers

How to design partial client side prediction if client stores only partial state?

tl;dr: if we keep the true state secret and only expose parts of it that should be visible to the requesting user via a "state view", how can we implement client side prediction (of things that could be predicted) considering that state updates…
Ben Usman
  • 7,969
  • 6
  • 46
  • 66
0
votes
1 answer

React-Apollo: Query with variables causes the UI to no longer be optimistic

I'm writing a React component using Apollo GraphQL (with React Apollo Hooks, but this makes no difference). Here is my query: const { data, error, loading } = useQuery(ListContacts, { fetchPolicy: 'cache-and-network' // variables: { limit: 1000…
J. Hesters
  • 13,117
  • 31
  • 133
  • 249
0
votes
1 answer

React apollo mutation and optimistic updates

I am using a graphql HOC with mutation for a input type of checkbox. I have also added optimistic UI update option to it. Checking the box will fire a mutation with value=true and unchecking will fire a mutation with value=false. But the problem is…
0
votes
1 answer

Graphql Apollo Optimistic UI pattern - handle actual result?

We are following the optimistic ui pattern (http://dev.apollodata.com/react/optimistic-ui.html) with the apollo graphql client. Is there a way to handle the actual result from the server? For example, if the server did error on the mutation, we…
Mark
  • 4,446
  • 5
  • 26
  • 34
0
votes
1 answer

Meteor: optimistic ui and appCache

How does a meteor application deal with server-side methods for inserting and updating? especially: if an application is temporarily offline (available through appCache-package) and a call to a server-side method happens: is optimistic-ui…
elCapitano
  • 1,821
  • 3
  • 22
  • 42
1
2