Skip to content

Instantly share code, notes, and snippets.

@jonnysamps
Last active February 25, 2021 00:03
Show Gist options
  • Save jonnysamps/3edf112078eafb0663fd29f5f1b6a376 to your computer and use it in GitHub Desktop.
Save jonnysamps/3edf112078eafb0663fd29f5f1b6a376 to your computer and use it in GitHub Desktop.
Apollo Client Best Practices - 3
// Fires immediately and then on an interval
timer(0, REFRESH_INTERVAL)
.pipe(
mergeMap(() => apollo.query({ query: gql`...` })),
map(result => result.data)
)
.subscribe(() => {
// fires once per http request
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment