Skip to content

Instantly share code, notes, and snippets.

@victorbrndls
Created February 7, 2022 22:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save victorbrndls/e3daaf6a6ac32e23180b3d9b433e62ad to your computer and use it in GitHub Desktop.
Save victorbrndls/e3daaf6a6ac32e23180b3d9b433e62ad to your computer and use it in GitHub Desktop.
public void writeMutations(List<Mutation> mutations, TaskCompletionSource<Void> userTask) {
// Write mutations locally using LocalStore
LocalWriteResult result = localStore.writeLocally(mutations);
...
// Dispatch changes to EventManager who updates active query listeners
emitNewSnapsAndNotifyLocalStore(result.getChanges(), /*remoteEvent=*/ null);
// Tell RemoteStore there're mutations to be sent to the backend
remoteStore.fillWritePipeline();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment