Skip to content

Instantly share code, notes, and snippets.

View ersinakinci's full-sized avatar

Ersin Akinci ersinakinci

View GitHub Profile
@ersinakinci
ersinakinci / globalFetchingExchange.js
Last active February 9, 2022 23:08
urql exchange for monitoring global fetching status
/* A naively-implemented urql exchange for monitoring whether urql is fetching
* a query or a mutation on a global level.
*
* https://formidable.com/open-source/urql/docs/concepts/exchanges
* https://wonka.kitten.sh
* https://wonka.kitten.sh/api/operators#onpush
*
* Example usage:
*
* // If this number is greater than 0, an operation is in-flight and so urql is fetching