{"_id":"apollo-link-debounce","_rev":"8-811f7b4f3267f668737eb8cc8ce22ffe","name":"apollo-link-debounce","description":"An Apollo Link to debounce requests","dist-tags":{"latest":"3.0.0","next":"2.0.0"},"versions":{"0.0.1":{"name":"apollo-link-debounce","version":"0.0.1","description":"An Apollo Link to debounce requests","dependencies":{"apollo-link":"^0.7.0"},"devDependencies":{"@types/graphql":"^0.11.7","@types/jest":"^20.0.8","@types/node":"^8.0.26","codecov":"^2.3.0","graphql":"^0.11.7","graphql-tag":"^2.4.2","nyc":"^11.2.1","react-scripts-ts":"^2.6.0","tslint":"^5.8.0","typescript":"^2.6.2"},"main":"build/dist/index.js","module":"build/dist/index.js","jsnext:main":"build/dist/index.js","typings":"build/dist/index.d.ts","scripts":{"build":"tsc","lint":"tslint src/*.ts* src/**/*.ts*","test":"react-scripts-ts test --coverage --collectCoverageFrom=src/**/*.ts* --collectCoverageFrom=!src/index.tsx --collectCoverageFrom=!src/**/*.snap && yarn run lint","testonly":"react-scripts-ts test --env=jsdom","coverage":"codecov -f coverage/*.json"},"keywords":["graphql","apollo","apollo-link","offline","queue"],"author":{"name":"Jonas Helfer","email":"jonas@helfer.email"},"license":"MIT","_id":"apollo-link-debounce@0.0.1","_npmVersion":"5.5.1","_nodeVersion":"8.9.1","_npmUser":{"name":"helfer","email":"helfer@meteor.com"},"dist":{"integrity":"sha512-3ipgbdQEMsq1tk1v3GqLCEb+2iuIC69hpnZ4IDVbhhUzKc+kfsjMdADtZG6YW5u0Yg+yxe3y1fJdk9ftwdBL4g==","shasum":"bbcc0485496386a130b38929930eda01482472f3","tarball":"https://registry.npmjs.org/apollo-link-debounce/-/apollo-link-debounce-0.0.1.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDVvXBVj+IwBXNMaRVLpAD2fpJrF7RvkFoZX3u4jtEjWAiEAmM85t8TjT5FPSGxYx/+c3jBN4KCqGlM0u2I1EAeuCng="}]},"maintainers":[{"name":"helfer","email":"helfer@meteor.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/apollo-link-debounce-0.0.1.tgz_1512199103270_0.43742353678680956"},"directories":{}},"1.0.0":{"name":"apollo-link-debounce","version":"1.0.0","description":"An Apollo Link to debounce requests","dependencies":{"apollo-link":"^0.7.0"},"devDependencies":{"@types/graphql":"^0.11.7","@types/jest":"^20.0.8","@types/node":"^8.0.26","codecov":"^2.3.0","graphql":"^0.11.7","graphql-tag":"^2.4.2","nyc":"^11.2.1","react-scripts-ts":"^2.6.0","tslint":"^5.8.0","typescript":"^2.6.2"},"main":"build/dist/index.js","module":"build/dist/index.js","jsnext:main":"build/dist/index.js","typings":"build/dist/index.d.ts","scripts":{"build":"tsc","lint":"tslint src/*.ts* src/**/*.ts*","test":"react-scripts-ts test --coverage --collectCoverageFrom=src/**/*.ts* --collectCoverageFrom=!src/index.tsx --collectCoverageFrom=!src/**/*.snap && yarn run lint","testonly":"react-scripts-ts test --env=jsdom","coverage":"codecov -f coverage/*.json"},"keywords":["graphql","apollo","apollo-link","offline","queue"],"author":{"name":"Jonas Helfer","email":"jonas@helfer.email"},"license":"MIT","gitHead":"efc3442b39def18b5291fab0dcc9af5c2e356b6e","_id":"apollo-link-debounce@1.0.0","_npmVersion":"5.5.1","_nodeVersion":"8.9.1","_npmUser":{"name":"helfer","email":"helfer@meteor.com"},"dist":{"integrity":"sha512-reea9BCoO8eZ7Dn8NFCGV7okruTfoqJRsrgvbhNW3KXU+bE0U1XMVTPVT1OnjEyu1vAlj6BHgW0wPNCoPBaKkg==","shasum":"400b44ed0fbc013c022fb1065859b5a512af05cb","tarball":"https://registry.npmjs.org/apollo-link-debounce/-/apollo-link-debounce-1.0.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCZToOwWw4+X9iNP0pj9bOKHL1WdGvcePPeh8z1XPqFtgIgS0x9NdzRYclkAyWg5GSlojTfEenro53RjdT+zIBz2no="}]},"maintainers":[{"name":"helfer","email":"helfer@meteor.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/apollo-link-debounce-1.0.0.tgz_1512262778322_0.9939563143998384"},"directories":{}},"1.0.1":{"name":"apollo-link-debounce","version":"1.0.1","description":"An Apollo Link to debounce requests","dependencies":{"apollo-link":"^0.7.0"},"devDependencies":{"@types/graphql":"^0.11.7","@types/jest":"^20.0.8","@types/node":"^8.0.26","codecov":"^2.3.0","graphql":"^0.11.7","graphql-tag":"^2.4.2","nyc":"^11.2.1","react-scripts-ts":"^2.6.0","tslint":"^5.8.0","typescript":"^2.6.2"},"main":"build/dist/index.js","module":"build/dist/index.js","jsnext:main":"build/dist/index.js","typings":"build/dist/index.d.ts","scripts":{"build":"tsc","lint":"tslint src/*.ts* src/**/*.ts*","test":"react-scripts-ts test --coverage --collectCoverageFrom=src/**/*.ts* --collectCoverageFrom=!src/index.tsx --collectCoverageFrom=!src/**/*.snap && yarn run lint","testonly":"react-scripts-ts test --env=jsdom","coverage":"codecov -f coverage/*.json"},"keywords":["graphql","apollo","apollo-link","offline","queue"],"author":{"name":"Jonas Helfer","email":"jonas@helfer.email"},"license":"MIT","gitHead":"20160ccd62313806b83fc243dbbca4343186ec23","_id":"apollo-link-debounce@1.0.1","_npmVersion":"5.5.1","_nodeVersion":"8.9.1","_npmUser":{"name":"helfer","email":"helfer@meteor.com"},"dist":{"integrity":"sha512-u9cwqj/ITI12DQNzRzOTaPoz1pT7seXWlJhkUeyIALFkoyddJHC35FSCAnKZ6N7l4qNTu/BQVHMDgnBzQ0GJhw==","shasum":"6c6c637118c142370b7e96ba5146ba2627a8161c","tarball":"https://registry.npmjs.org/apollo-link-debounce/-/apollo-link-debounce-1.0.1.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHz2l/vxwirvkI6AWoEIyFo+m6yCp1XUOMhXdJWRwYc6AiEAoyCWqIhHzOumH7OmrSfhLMkQem4J/0kTCFL6+goz0wE="}]},"maintainers":[{"name":"helfer","email":"helfer@meteor.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/apollo-link-debounce-1.0.1.tgz_1512276975986_0.5238826673012227"},"directories":{}},"1.0.2":{"name":"apollo-link-debounce","version":"1.0.2","description":"An Apollo Link to debounce requests","dependencies":{"apollo-link":"^0.7.0"},"devDependencies":{"@types/graphql":"^0.11.7","@types/jest":"^20.0.8","@types/node":"^8.0.26","codecov":"^2.3.0","graphql":"^0.11.7","graphql-tag":"^2.4.2","nyc":"^11.2.1","react-scripts-ts":"^2.6.0","tslint":"^5.8.0","typescript":"^2.6.2"},"main":"build/dist/index.js","module":"build/dist/index.js","repository":{"type":"git","url":"git+https://github.com/helfer/apollo-link-debounce.git"},"jsnext:main":"build/dist/index.js","typings":"build/dist/index.d.ts","scripts":{"build":"tsc","lint":"tslint src/*.ts* src/**/*.ts*","test":"react-scripts-ts test --coverage --collectCoverageFrom=src/**/*.ts* --collectCoverageFrom=!src/index.tsx --collectCoverageFrom=!src/**/*.snap && yarn run lint","testonly":"react-scripts-ts test --env=jsdom","coverage":"codecov -f coverage/*.json"},"keywords":["graphql","apollo","apollo-link","offline","queue"],"author":{"name":"Jonas Helfer","email":"jonas@helfer.email"},"license":"MIT","gitHead":"e6daba08c25bfe5dd51c3fcd7599a68d4d032c27","bugs":{"url":"https://github.com/helfer/apollo-link-debounce/issues"},"homepage":"https://github.com/helfer/apollo-link-debounce#readme","_id":"apollo-link-debounce@1.0.2","_npmVersion":"5.5.1","_nodeVersion":"8.9.1","_npmUser":{"name":"helfer","email":"helfer@meteor.com"},"dist":{"integrity":"sha512-yXQFMGGFoUpxTyOKeFZxSSQNfshoi7NCBLIzOcXVzAhFj0x3+nF3y8wJznsQVl8C0XWB7BS8owHmGi1AWT1TBg==","shasum":"84646de6b910099c80af27d042e913cb8708e78c","tarball":"https://registry.npmjs.org/apollo-link-debounce/-/apollo-link-debounce-1.0.2.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAM7WD5JRkvUBCvC16ucdQ/OodU5sIaopSx7hA9ry4AqAiBtmt2ayoAms7XbvDXyshbLXlmg4vfRkjKGVBo0x4DrxA=="}]},"maintainers":[{"name":"helfer","email":"helfer@meteor.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/apollo-link-debounce-1.0.2.tgz_1512343038630_0.5166574981994927"},"directories":{}},"2.0.0":{"name":"apollo-link-debounce","version":"2.0.0","description":"An Apollo Link to debounce requests","dependencies":{"apollo-link":"^0.7.0"},"devDependencies":{"@types/graphql":"^0.11.7","@types/jest":"^20.0.8","@types/node":"^8.0.26","codecov":"^2.3.0","graphql":"^0.11.7","graphql-tag":"^2.4.2","nyc":"^11.2.1","react-scripts-ts":"^2.6.0","tslint":"^5.8.0","typescript":"^2.6.2"},"main":"build/dist/index.js","module":"build/dist/index.js","repository":{"type":"git","url":"git+https://github.com/helfer/apollo-link-debounce.git"},"jsnext:main":"build/dist/index.js","typings":"build/dist/index.d.ts","scripts":{"build":"tsc","lint":"tslint src/*.ts* src/**/*.ts*","test":"react-scripts-ts test --coverage --collectCoverageFrom=src/**/*.ts* --collectCoverageFrom=!src/index.ts --collectCoverageFrom=!src/TestUtils.ts && yarn run lint","testonly":"react-scripts-ts test --env=jsdom","coverage":"codecov -f coverage/*.json"},"keywords":["graphql","apollo","apollo-link","offline","queue"],"author":{"name":"Jonas Helfer","email":"jonas@helfer.email"},"license":"MIT","gitHead":"346234ed57769916fbe73291a90d87b641b9a541","bugs":{"url":"https://github.com/helfer/apollo-link-debounce/issues"},"homepage":"https://github.com/helfer/apollo-link-debounce#readme","_id":"apollo-link-debounce@2.0.0","_npmVersion":"5.5.1","_nodeVersion":"8.9.1","_npmUser":{"name":"helfer","email":"jonas@helfer.email"},"dist":{"integrity":"sha512-5Pwos/MMzAylaqHGUsHkqes4qlkLLLC+RBW2sstKZ3r5kT1tReI19Zd/BYb187NOpwqTnwc84Pen/VZNwKW8IQ==","shasum":"051193b5396e056a2b87b09a2ffe404c1ab0e4f3","tarball":"https://registry.npmjs.org/apollo-link-debounce/-/apollo-link-debounce-2.0.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAHIpoqRKzlhhLcF3oue1A8Sa+IhjDGuDaRAhvm23354AiANrsKGY8z9eCVhfRARuCfsMFfpFHS/g4TXqF6cKQKmvQ=="}]},"maintainers":[{"name":"helfer","email":"helfer@meteor.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/apollo-link-debounce-2.0.0.tgz_1512669415705_0.4421449778601527"},"directories":{}},"2.1.0":{"name":"apollo-link-debounce","version":"2.1.0","description":"An Apollo Link to debounce requests","dependencies":{"apollo-link":"^1.2.2","zen-observable-ts":"^0.8.9"},"devDependencies":{"@types/graphql":"^0.13.0","@types/jest":"^23.1.4","@types/node":"10.1.2","codecov":"^3.0.3","graphql":"^0.13.2","graphql-tag":"^2.9.2","nyc":"^11.2.1","react-scripts-ts":"^2.16.0","tslint":"^5.8.0","typescript":"^2.6.2"},"main":"build/dist/index.js","module":"build/dist/index.js","repository":{"type":"git","url":"git+https://github.com/helfer/apollo-link-debounce.git"},"jsnext:main":"build/dist/index.js","typings":"build/dist/index.d.ts","scripts":{"build":"tsc","lint":"tslint src/*.ts* src/**/*.ts*","test":"react-scripts-ts test --coverage --collectCoverageFrom=src/**/*.ts* --collectCoverageFrom=!src/index.ts --collectCoverageFrom=!src/TestUtils.ts && yarn run lint","testonly":"react-scripts-ts test --env=jsdom","coverage":"codecov -f coverage/*.json"},"keywords":["graphql","apollo","apollo-link","offline","queue"],"author":{"name":"Jonas Helfer","email":"jonas@helfer.email"},"license":"MIT","gitHead":"b113a7a69dbc630dd4819ddbdfb98d20029a6c1b","bugs":{"url":"https://github.com/helfer/apollo-link-debounce/issues"},"homepage":"https://github.com/helfer/apollo-link-debounce#readme","_id":"apollo-link-debounce@2.1.0","_npmVersion":"5.5.1","_nodeVersion":"8.9.1","_npmUser":{"name":"helfer","email":"jonas@helfer.email"},"dist":{"integrity":"sha512-tpAb3558SoZVKL8Y5N1pyrw4ko9eYWGpveKCp1fjfDz8bA4977fyfR4OZdrxwBtTjhYf5wNq2N9YTtKaq3OZIg==","shasum":"8bf34988d94ab28d73d23de0cf26777235a6bfd7","tarball":"https://registry.npmjs.org/apollo-link-debounce/-/apollo-link-debounce-2.1.0.tgz","fileCount":22,"unpackedSize":333257,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcCi5uCRA9TVsSAnZWagAAeAwP/2sKGcm06mmO51DMJx9O\nY9tzck23vx2MyYjgtNgFyJkpBdlF4at3IxENmjTFxFlQTCRKXLWaCvV83rzO\nx3QR1FyjTPHoPIKViodOjqT1n6bBWyRDvPl+reIuMD4QfLI8IFP8iAcx7zDN\n7E/gJQg+9KUP65W0HW6leXNuHzJT2q4EA9RNA3wWOr4co0FVA0990UZlzCqy\n50mG6P95L+tMoMkgICvL7H0CBEd6+2VYj7IVBCCm6l52+Puf/3h6mEF0dVk0\nuUdQLYRIZu01XQGrCqIWtNJ9TuKoDTyzgbSg1skptTOyMZjjyM9Vbh5fgrC1\nFzpAKOH0wcGx1+8YEj2dvm5g/4BZGfWycezVgeNK9EqCcNxPvSl4dWVfEvGl\ncQQuZ/RtCoBlbyaMJUmya3VWICb+qiGKi0oZstT/y/fkOAJJr3KtwPdxAY8F\niPV/WjO2d3GNnPnPkbsjUZd2uAPecEA8fheg9efwXZd2m3zenMvvRv3p4a/1\nJ2tDRFDczzauBxAe+T8mLJnHWw81SGyLxcvMtXgvaGBq3Ve9DLElpUD2oYIi\n+I0LhEwbjiBcX62Uvr8sK3pZ3+U5aZ8hk6L4eb6zD3j4bLDpFK2twRkDk96R\niOPwLCF+qeMsaF84xM2OK/93T/AarWN9w/XL3LYOUluQWSnWrkvQtAQB/cur\ndDL4\r\n=OrRJ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDAbgHzYL/JlEMGDVTve0B1SKan71pAYvqYey1MiNmQiAiEA292FzWH6P5AIC1y/RSy7LI9QwmuZiNhhOtqP0nTnTuY="}]},"maintainers":[{"name":"helfer","email":"helfer@meteor.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/apollo-link-debounce_2.1.0_1544171117890_0.5711332980701009"},"_hasShrinkwrap":false},"3.0.0":{"name":"apollo-link-debounce","version":"3.0.0","description":"An Apollo Link to debounce requests","peerDependencies":{"@apollo/client":"^3.0.0"},"devDependencies":{"@apollo/client":"^3.0.0","@types/graphql":"^0.13.0","@types/jest":"^23.1.4","@types/node":"^13.13.2","@types/react":"^16.9.34","codecov":"^3.0.3","graphql":"^15.0.0","nyc":"^11.2.1","react":"^17.0.0","react-scripts-ts":"^2.16.0","tslint":"^5.8.0","typescript":"^3.8.3"},"main":"build/dist/index.js","module":"build/dist/index.js","repository":{"type":"git","url":"git+https://github.com/helfer/apollo-link-debounce.git"},"jsnext:main":"build/dist/index.js","typings":"build/dist/index.d.ts","scripts":{"build":"tsc","lint":"tslint src/*.ts* src/**/*.ts*","test":"react-scripts-ts test --coverage --collectCoverageFrom=src/**/*.ts* --collectCoverageFrom=!src/index.ts --collectCoverageFrom=!src/TestUtils.ts && yarn run lint","testonly":"react-scripts-ts test --env=jsdom","prepack":"yarn run build","coverage":"codecov -f coverage/*.json"},"keywords":["graphql","apollo","apollo-link","@apollo/client","offline","queue"],"author":{"name":"Jonas Helfer","email":"jonas@helfer.email"},"license":"MIT","gitHead":"84bd3960a13c24b99b0640757e7e5702f697348e","bugs":{"url":"https://github.com/helfer/apollo-link-debounce/issues"},"homepage":"https://github.com/helfer/apollo-link-debounce#readme","_id":"apollo-link-debounce@3.0.0","_nodeVersion":"14.16.1","_npmVersion":"6.14.12","dist":{"integrity":"sha512-Ytig2Ml41T2bovBIoKkStPKoIh0r/kTK1dSM9Gpvo5W3BAPxt1WguAkeaPLJqeuvrNJIjQ/Pl38/14VVA0hdYg==","shasum":"39a82a5d0e53ece75a67f56d7c50d9a122631787","tarball":"https://registry.npmjs.org/apollo-link-debounce/-/apollo-link-debounce-3.0.0.tgz","fileCount":21,"unpackedSize":60650,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJginZZCRA9TVsSAnZWagAAWt4P/i3NhXEy5qMznTTWEqly\nMhN9Mwdy4sFXCZsUekSAVmdzlxGR1SE3yJ/zrG+5lisM+nyHcOTa1+ame8t6\nA/64IIYNPqv7cYTlJerqT7MXFO+dsenWDpvztKfAhBVXtNwCXYqlePJmIiwM\nYrMbb5xGxfRUUyCT/XMk25/dH19ay42lAB4axJSKPIvuHOKmYzQdyqGM2INN\nxnt4Qo7vNJzOXwAayYS0OUwZv/ZMC46Mw81tzFQn307tZy3Ikc7iIcGCHuag\nKIzQAcWMEuer7QhwsR8Xrii3O9O77KeE4k5GPiUgMs3ik7HmDjTMxACwYcXj\nfFfLTSRyTl8WefNsXwd4zLwJWeMn4SljgpMX7x2Jvam+PjPcE3BUT3Thz35A\nvsGad6SSy1tIQPCHH9cOh19PVDhyisbXfBxOgv+2zZf5OIqpS6hiy+y7bFaj\n9dgArUiC/Kv43LNkNUtEMfaPVWpLOdyEnvoL24lIIL6dI++l2UDsUsg8OrlB\nXHCWn77xVlHjKqrwRBXzk7MWtzxL46BgRccISZ5OFIZ80jCTGQSfOh1tGYiR\nMqygAsbikStfPr2bsJDVDXRsVHVMMt2krWeKcr4dpky/IWkjed/nnnOH7qyF\noIOH2+v0ilMBjAtQDizkkRbbTG973/HuNKxXlTA2NfmtdI9I4iEX2WXIiCNc\nGjTp\r\n=uWOQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCkV28oOe60U3UhFVhWVunhkTDIuFvwOrE45KtAqh3DQwIgV7Q6lmOluSZezn4REIo4f+zVFc3wy6LG+frVGU2zoN0="}]},"_npmUser":{"name":"helfer","email":"helfer@protonmail.com"},"directories":{},"maintainers":[{"name":"helfer","email":"helfer@protonmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/apollo-link-debounce_3.0.0_1619687001377_0.47735121662353475"},"_hasShrinkwrap":false}},"readme":"# apollo-link-debounce\n\n[![npm version](https://badge.fury.io/js/apollo-link-debounce.svg)](https://badge.fury.io/js/apollo-link-debounce)\n[![Build Status](https://travis-ci.org/helfer/apollo-link-debounce.svg?branch=master)](https://travis-ci.org/helfer/apollo-link-debounce)\n[![codecov](https://codecov.io/gh/helfer/apollo-link-debounce/branch/master/graph/badge.svg)](https://codecov.io/gh/helfer/apollo-link-debounce)\n\nAn Apollo Link that debounces requests made within a certain interval of each other.\n\n### Motivation\n\nSometimes it can be useful to debounce updates by the user before sending them to the server if all that matters is the final state, for example the value at which a slider comes to rest after being moved by the user. You could debounce the slider event at the component level, but that's not always an option when there are other parts of the UI that depend on having the most up-to-date information on the slider position.\n\nApollo-link-debounce can help in such situations by allowing you to debounce requests. Slider position, for example, could be debounced such that if multiple slider events happen within 100ms of each other, only the last position update (mutation) gets sent to the server. Once the server response comes back, all subscribers will receive the response to the last event. (Another option would be to immediately complete all but the last request. If you need that, feel free to make a PR implementing it!)\n\nIt is possible to debounce different events separately by setting different debounce keys. For example: if there are two sliders, they can use separate debounce keys (eg. the slider's name) to ensure that their updates don't get mixed up together.\n\nRead more about debounce [here](https://john-dugan.com/javascript-debounce/).\nSee a real-world example of using a debounce link [here](https://github.com/helfer/zetteli/blob/817e43c598d55b81983b19cac4ff9f1b199d0e28/client/src/services/GraphQLClient.ts#L88).\n\n### Installation\n\n```sh\nnpm install apollo-link-debounce\n```\n\nor\n\n```\nyarn add apollo-link-debounce\n```\n\n### Usage\n\n```js\nimport { gql, ApolloLink, HttpLink } from '@apollo/client';\nimport { RetryLink } from '@apollo/client/link/retry';\n\nimport DebounceLink from 'apollo-link-debounce';\n\nconst DEFAULT_DEBOUNCE_TIMEOUT = 100;\nthis.link = ApolloLink.from([\n    new DebounceLink(DEFAULT_DEBOUNCE_TIMEOUT),\n    new HttpLink({ uri: URI_TO_YOUR_GRAPHQL_SERVER }),\n]);\n\nconst op = {\n    query: gql`mutation slide($val: Float){ moveSlider(value: $val) }`,\n    variables: { val: 99 }\n    context: {\n        // Requests get debounced together if they share the same debounceKey.\n        // Requests without a debounce key are passed to the next link unchanged.\n        debounceKey: '1',\n    },\n};\n\nconst op2 = {\n    query: gql`mutation slide($val: Float){ moveSlider(value: $val) }`,\n    variables: { val: 100 },\n    context: {\n        // Requests get debounced together if they share the same debounceKey.\n        // Requests without a debounce key are passed to the next link unchanged.\n        debounceKey: '1',\n    },\n};\n\n// Different debounceKeys can have different debounceTimeouts\nconst op3 = {\n    query: gql`query autoComplete($val: String) { autoComplete(value: $val) { value } }`,\n    variables: { val: 'apollo-link-de' }, // Server returns \"apollo-link-debounce\"\n    context: {\n        // DEFAULT_DEBOUNCE_TIMEOUT is overridden by setting debounceTimeout\n        debounceKey: '2',\n        debounceTimeout: 10,\n    },\n};\n\n\n// No debounce key, so this request does not get debounced\nconst op4 = {\n    query: gql`{ hello }`, // Server returns \"World!\"\n};\n\nlink.execute(op).subscribe({\n    next(response) { console.log('A', response.data.moveSlider); },\n    complete() { console.log('A complete!'); },\n});\nlink.execute(op2).subscribe({\n    next(response) { console.log('B', response.data.moveSlider); },\n    complete() { console.log('B complete!'); },\n});\nlink.execute(op3).subscribe({\n    next(response) { console.log('C', response.data.autoComplete.value); },\n    complete() { console.log('C complete!'); },\n});\nlink.execute(op4).subscribe({\n    next(response) { console.log('Hello', response.data.hello); },\n    complete() { console.log('Hello complete!'); },\n});\n\n// Assuming the server responds with the value that was set, this will print\n// -- no delay --\n// Hello World!\n// Hello complete!\n// -- 10 ms delay --\n// C apollo-link-debounce\n// C complete!\n// -- 100 ms delay --\n// A 100 (after 100ms)\n// A complete!\n// B 100\n// B complete!\n```\n","maintainers":[{"name":"helfer","email":"helfer@protonmail.com"}],"time":{"modified":"2022-04-11T14:44:20.203Z","created":"2017-12-02T07:18:23.420Z","0.0.1":"2017-12-02T07:18:23.420Z","1.0.0":"2017-12-03T00:59:38.427Z","1.0.1":"2017-12-03T04:56:16.089Z","1.0.2":"2017-12-03T23:17:18.696Z","2.0.0":"2017-12-07T17:56:55.818Z","2.1.0":"2018-12-07T08:25:18.086Z","3.0.0":"2021-04-29T09:03:21.491Z"},"keywords":["graphql","apollo","apollo-link","@apollo/client","offline","queue"],"author":{"name":"Jonas Helfer","email":"jonas@helfer.email"},"license":"MIT","readmeFilename":"README.md","homepage":"https://github.com/helfer/apollo-link-debounce#readme","repository":{"type":"git","url":"git+https://github.com/helfer/apollo-link-debounce.git"},"bugs":{"url":"https://github.com/helfer/apollo-link-debounce/issues"}}