@urql/exchange-refocus
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

@urql/exchange-refocus

@urql/exchange-refocus is an exchange for the urql GraphQL client that tracks currently active operations and redispatches them when the window regains focus

Quick Start Guide

First install @urql/exchange-refocus alongside urql:

yarn add @urql/exchange-refocus
# or
npm install --save @urql/exchange-refocus

Then add it to your Client, preferably after the dedupExchange but in front of any asynchronous exchanges, like the fetchExchange:

import { createClient, dedupExchange, cacheExchange, fetchExchange } from 'urql';
import { refocusExchange } from '@urql/exchange-refocus';

const client = createClient({
  url: 'http://localhost:3000/graphql',
  exchanges: [dedupExchange, refocusExchange(), cacheExchange, fetchExchange],
});

Package Sidebar

Install

npm i @urql/exchange-refocus

Weekly Downloads

5,784

Version

1.0.2

License

MIT

Unpacked Size

26.3 kB

Total Files

13

Last publish

Collaborators

  • scottianstewart
  • keithluchtel
  • ceceppa
  • robwalkerco
  • sarahformidable
  • scott-rippey
  • michaelmerrill
  • sarmeyer
  • mariano-formidable
  • ryan.roemer
  • formidable-owner
  • formidablelabs
  • carbonrobot
  • masiddee
  • philpl
  • andyrichardson
  • jdecroock
  • parkerziegler
  • npm-urql