Comments (12)
@1v4nx published ur work to npm because I would like to use it right away.. -> https://www.npmjs.com/package/omerman-apollo-link-debounce
from apollo-link-debounce.
I went ahead and updated everything in my fork: https://github.com/arcanis/apollo-link-debounce
TSLint doesn't pass (for infra reasons - a bunch of rules aren't detected) so I haven't opened a PR, let me know if you'd still be interested
from apollo-link-debounce.
While we wait for the PR, you can apply this patch with patch-package
(this patch also happens to convert the file to standard modules for better browser support)
patches/apollo-link-debounce+2.1.0.patch
diff --git a/node_modules/apollo-link-debounce/build/dist/DebounceLink.d.ts b/node_modules/apollo-link-debounce/build/dist/DebounceLink.d.ts
index 06bf050..c48a961 100644
--- a/node_modules/apollo-link-debounce/build/dist/DebounceLink.d.ts
+++ b/node_modules/apollo-link-debounce/build/dist/DebounceLink.d.ts
@@ -1,5 +1,4 @@
-import { ApolloLink, Operation, NextLink } from 'apollo-link';
-import { Observable } from 'zen-observable-ts';
+import { ApolloLink, Operation, NextLink, Observable } from '@apollo/client/core ';
export default class DebounceLink extends ApolloLink {
private debounceInfo;
private defaultDelay;
diff --git a/node_modules/apollo-link-debounce/build/dist/DebounceLink.js b/node_modules/apollo-link-debounce/build/dist/DebounceLink.js
index f52668b..f66932c 100644
--- a/node_modules/apollo-link-debounce/build/dist/DebounceLink.js
+++ b/node_modules/apollo-link-debounce/build/dist/DebounceLink.js
@@ -1,4 +1,3 @@
-"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
@@ -9,10 +8,9 @@ var __extends = (this && this.__extends) || (function () {
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
-exports.__esModule = true;
-var apollo_link_1 = require("apollo-link");
-var zen_observable_ts_1 = require("zen-observable-ts");
-var DebounceLink = (function (_super) {
+import { ApolloLink } from "@apollo/client/link/core";
+import { Observable } from "@apollo/client/utilities";
+const DebounceLink = (function (_super) {
__extends(DebounceLink, _super);
function DebounceLink(defaultDelay) {
var _this = _super.call(this) || this;
@@ -63,7 +61,7 @@ var DebounceLink = (function (_super) {
if (!debounceKey) {
return forward(operation);
}
- return new zen_observable_ts_1.Observable(function (observer) {
+ return new Observable(function (observer) {
var debounceGroupId = _this.enqueueRequest({ debounceKey: debounceKey, debounceTimeout: debounceTimeout }, { operation: operation, forward: forward, observer: observer });
return function () {
_this.unsubscribe(debounceKey, debounceGroupId, observer);
@@ -123,6 +121,6 @@ var DebounceLink = (function (_super) {
dbi.currentGroupId++;
};
return DebounceLink;
-}(apollo_link_1.ApolloLink));
-exports["default"] = DebounceLink;
+}(ApolloLink));
+export default DebounceLink;
//# sourceMappingURL=DebounceLink.js.map
\ No newline at end of file
diff --git a/node_modules/apollo-link-debounce/build/dist/index.d.ts b/node_modules/apollo-link-debounce/build/dist/index.d.ts
index bc94fdf..d45236d 100644
--- a/node_modules/apollo-link-debounce/build/dist/index.d.ts
+++ b/node_modules/apollo-link-debounce/build/dist/index.d.ts
@@ -1,2 +1,3 @@
import DebounceLink from './DebounceLink';
+export { DebounceLink };
export default DebounceLink;
diff --git a/node_modules/apollo-link-debounce/build/dist/index.js b/node_modules/apollo-link-debounce/build/dist/index.js
index 2f651f0..f5a365f 100644
--- a/node_modules/apollo-link-debounce/build/dist/index.js
+++ b/node_modules/apollo-link-debounce/build/dist/index.js
@@ -1,5 +1,3 @@
-"use strict";
-exports.__esModule = true;
-var DebounceLink_1 = require("./DebounceLink");
-exports["default"] = DebounceLink_1["default"];
-//# sourceMappingURL=index.js.map
\ No newline at end of file
+import DebounceLink from './DebounceLink.js';
+export { DebounceLink };
+export default DebounceLink;
By the way, I noticed you're exporting CJS Modules with classes compiled down to ES5. Would you consider a further PR (after this one) that would change the output target to, say, ES2017 and the module format to standard ES Modules? That would help with bundle size and runtime performance. Legacy users would still be able to transpile at build-time as an app-level operation.
from apollo-link-debounce.
@arcanis if you can, please open a PR. I can fix the build if necessary.
from apollo-link-debounce.
I don't have time to open a PR at the moment, but feel free to fork my fork and open one to this repo
from apollo-link-debounce.
@helfer Can you please take a look at #15?? It would be great to move forward with it ASAP :)
from apollo-link-debounce.
@helfer Any updates on this V3 compatibility?
Thanks @omerman!
from apollo-link-debounce.
Unfortunately, this project seems to abandoned. What a shame :/
@helfer do you intend to keep maintaining this project?
@arcanis I think you should open the PR, please :)
from apollo-link-debounce.
It would be awesome to be able to continue using this package!
from apollo-link-debounce.
Hey @arcanis! Any change you can create the PR soon?? If you prefer I can do it for you, I just don't want to take credit for something I haven't done :)
from apollo-link-debounce.
@helfer I just created #15 with changes from @arcanis and some extra updates :)
I also tried to fix those lint rules, but even when migrating from tslint to eslint those end up unrecognized.
from apollo-link-debounce.
@helfer would be much appreciated – running into the same issues as others
from apollo-link-debounce.
Related Issues (7)
- Merge variables objects when flushing queue HOT 4
- Feature request: use abortController to cancel any running requests when a new one is queued
- Optimistic Response with debounce mutations HOT 3
- set debounce time on query level HOT 2
- add 'waiting' state HOT 1
- `Missing field ...` warnings are thrown when request is debounced HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from apollo-link-debounce.