Skip to main content
optimistic edits this client’s live watches at head. A refusal removes the edit immediately. After a successful mutation, the client keeps the edit until every affected watch reaches the commit’s version or a later version.
answers.edit(fn, args, update) replaces the value of a query this client is watching with those arguments. A query not watched with those arguments is left alone. update receives the current value and returns the next one: treat values as immutable and return a new one. The client may run the callback again as new values arrive, so keep it pure and synchronous. The same option works on client.mutate:
Show the pending state with rename.pending, and read the mutation’s Result for a refusal: the edit is gone by then, so the list already shows the committed value again.