Closed mroderick closed 4 years ago
Merging #22 into master will not change coverage. The diff coverage is
n/a
.
@@ Coverage Diff @@
## master #22 +/- ##
=====================================
Coverage 100% 100%
=====================================
Files 23 23
Lines 207 207
=====================================
Hits 207 207
Flag | Coverage Δ | |
---|---|---|
#unit | 100% <ø> (ø) |
:arrow_up: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update f75ea5a...a9f94f9. Read the comment docs.
Documentation notes:
plete
to work in legacy browsers
We could point people towards using polyfill.io
, or recommend they run their own version of it: https://kentcdodds.com/blog/polyfill-as-needed-with-polyfill-service
Would like to discuss the datasrc-as-function.test.js on Friday.
Let's do that! We can write some more tests for it!
This has been published as plete@0.3.0
This PR fixes #5
Background
When filtering using remote services, it can be beneficial to cancel requests, especially when the network is unstable and responses appear out of order.
Aborting old requests, mean that only the last request will be used.
Solution
With the changes in the PR, the
dataSrc
functions can return an object withpromise
andabort
properties, in addition to the existing promise.The
abort
function will be called before the next call to thedataSrc
function.Abandoned solution: We tried implementing this using an array returned from
dataSrc
. However, that makes it difficult to differentiate between the situations, where we want to use anabort
function, and when thedataSrc
returns an array of results. Using an object with named properties, makes it easy to detect theabort
scenario.An example with aborting has been added to the
index.html
file, which is for development purposes.Once this PR is merged, we can cut a new
minor
version, and update the documentation site.How to verify
npm ci
npm start
Previous request aborted
is logged to the console when requests are aborted