Closed ezraberch closed 4 years ago
Merging #24 into master will increase coverage by
0.25%
. The diff coverage is92.50%
.
@@ Coverage Diff @@
## master #24 +/- ##
==========================================
+ Coverage 85.77% 86.03% +0.25%
==========================================
Files 21 21
Lines 682 716 +34
==========================================
+ Hits 585 616 +31
- Misses 97 100 +3
Impacted Files | Coverage Δ | |
---|---|---|
Sources/Request/Request/Request.swift | 93.26% <89.28%> (-1.86%) |
:arrow_down: |
Tests/RequestTests/RequestTests.swift | 93.28% <100.00%> (+0.33%) |
: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 db1db61...0db9e72. Read the comment docs.
This looks great!
I have two notes:
public func update(every seconds: Double) -> Self
use TimeInterval
instead of Double.combineIdentifier
if the class doesn't conform to CustomCombineIdentifierConvertible
? Also, could it be a constant instead of a variable?If you create a custom Subscription or Subscriber type, implement this protocol so that development tools can uniquely identify publisher chains in your app. If your type is a class, Combine provides an implementation of combineIdentifier for you. If your type is a structure, set up the identifier as follows: let combineIdentifier = CombineIdentifier()
You're right that it should be a constant; that has been fixed.
This PR adds functionality to Request which allows for the Request to be repeated after the initial call. An example use case is an automatically-updating RequestView.
The following SwiftUI view is an example of this. The RequestView will call the request to load the content once when the view loads. Thereafter, the view will automatically update every 10 seconds. The view will also be updated whenever the user taps the button.