Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(CombineBridge): Draft implementation #218

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

maximkrouk
Copy link

@maximkrouk maximkrouk commented Aug 14, 2021

It's a draft implementation for #217

  • Should it be finished?
  • Should it be implemented here or as a separate package?
  • What do you think about the implementation and naming?

Notes:

  • I use some reflection to get rawValues from Subscribers.Demand and CombineIdentifier and to create new ones with the same underlying value, so the implementation relies on Combine's private APIs
  • Also, if it fits this package, maybe it worth creating a separate branch for the bridge
  • Also, I noticed that your main branch is master, most of the modern projects use main already, maybe it worth renaming master to main 馃寶

@codecov
Copy link

codecov bot commented Aug 14, 2021

Codecov Report

Merging #218 (03668c2) into master (b27b2c3) will decrease coverage by 2.13%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #218      +/-   ##
==========================================
- Coverage   97.73%   95.60%   -2.14%     
==========================================
  Files         100      109       +9     
  Lines        6946     7101     +155     
==========================================
  Hits         6789     6789              
- Misses        157      312     +155     
Impacted Files Coverage 螖
...ources/OpenCombineBridge/Cancellable+Adapter.swift 0.00% <0.00%> (酶)
.../OpenCombineBridge/CombineIdentifier+Adapter.swift 0.00% <0.00%> (酶)
Sources/OpenCombineBridge/Helpers/CopyValue.swift 0.00% <0.00%> (酶)
Sources/OpenCombineBridge/Publisher+Adapter.swift 0.00% <0.00%> (酶)
Sources/OpenCombineBridge/Subject+Adapter.swift 0.00% <0.00%> (酶)
Sources/OpenCombineBridge/Subscriber+Adapter.swift 0.00% <0.00%> (酶)
...CombineBridge/Subscribers.Completion+Adapter.swift 0.00% <0.00%> (酶)
...OpenCombineBridge/Subscribers.Demand+Adapter.swift 0.00% <0.00%> (酶)
...urces/OpenCombineBridge/Subscription+Adapter.swift 0.00% <0.00%> (酶)
... and 8 more

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 b27b2c3...03668c2. Read the comment docs.

init(_ combineIdentifier: OpenCombine.CombineIdentifier) {
self.init(rawValue: _rawValue(for: combineIdentifier))
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • 馃毇 Lines should not have trailing whitespace. (trailing_whitespace)

as: Combine.CombineIdentifier()
)
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • 馃毇 Lines should not have trailing whitespace. (trailing_whitespace)

public typealias Failure = Subject.Failure

public func receive<S>(subscriber: S)
where S: OpenCombine.Subscriber, Subject.Failure == S.Failure, Subject.Output == S.Input {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • 馃毇 Line should be 90 characters or less: currently 92 characters (line_length)

public var combineIdentifier: OpenCombine.CombineIdentifier {
subscriber.combineIdentifier.ocombine
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • 馃毇 Lines should not have trailing whitespace. (trailing_whitespace)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants