From 291803c31f829fe0d32bb3207bc11def95a7408c Mon Sep 17 00:00:00 2001 From: Nevena Bojovic Date: Tue, 1 Mar 2022 20:05:50 +0100 Subject: Urađena test aplikacija. Povezan front i back. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Front/node_modules/promise-inflight/README.md | 34 ++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 sandbox/testAppNevena/Front/node_modules/promise-inflight/README.md (limited to 'sandbox/testAppNevena/Front/node_modules/promise-inflight/README.md') diff --git a/sandbox/testAppNevena/Front/node_modules/promise-inflight/README.md b/sandbox/testAppNevena/Front/node_modules/promise-inflight/README.md new file mode 100644 index 00000000..f0ae3a44 --- /dev/null +++ b/sandbox/testAppNevena/Front/node_modules/promise-inflight/README.md @@ -0,0 +1,34 @@ +# promise-inflight + +One promise for multiple requests in flight to avoid async duplication + +## USAGE + +```javascript +const inflight = require('promise-inflight') + +// some request that does some stuff +function req(key) { + // key is any random string. like a url or filename or whatever. + return inflight(key, () => { + // this is where you'd fetch the url or whatever + return Promise.delay(100) + }) +} + +// only assigns a single setTimeout +// when it dings, all thens get called with the same result. (There's only +// one underlying promise.) +req('foo').then(…) +req('foo').then(…) +req('foo').then(…) +req('foo').then(…) +``` + +## SEE ALSO + +* [inflight](https://npmjs.com/package/inflight) - For the callback based function on which this is based. + +## STILL NEEDS + +Tests! -- cgit v1.2.3