Git Product home page Git Product logo

Comments (12)

omerman avatar omerman commented on May 18, 2024 6

@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.

arcanis avatar arcanis commented on May 18, 2024 3

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.

bennypowers avatar bennypowers commented on May 18, 2024 3

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.

helfer avatar helfer commented on May 18, 2024 2

@arcanis if you can, please open a PR. I can fix the build if necessary.

from apollo-link-debounce.

arcanis avatar arcanis commented on May 18, 2024 1

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.

1v4nx avatar 1v4nx commented on May 18, 2024 1

@helfer Can you please take a look at #15?? It would be great to move forward with it ASAP :)

from apollo-link-debounce.

nmelton-rh avatar nmelton-rh commented on May 18, 2024 1

@helfer Any updates on this V3 compatibility?
Thanks @omerman!

from apollo-link-debounce.

brunocechet avatar brunocechet commented on May 18, 2024

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.

Trunksome avatar Trunksome commented on May 18, 2024

It would be awesome to be able to continue using this package!

from apollo-link-debounce.

1v4nx avatar 1v4nx commented on May 18, 2024

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.

1v4nx avatar 1v4nx commented on May 18, 2024

@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.

drummerjolev avatar drummerjolev commented on May 18, 2024

@helfer would be much appreciated – running into the same issues as others

from apollo-link-debounce.

Related Issues (7)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.