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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds ReplaySubject and Publisher.share(replay:) #23

Merged
merged 11 commits into from
Apr 19, 2020
Merged

Adds ReplaySubject and Publisher.share(replay:) #23

merged 11 commits into from
Apr 19, 2020

Conversation

jasdev
Copy link
Member

@jasdev jasdev commented Apr 13, 2020

h/t to @tcldr for the reference implementation I leaned on and adapted to Shai’s DemandBuffer type. 💯

@codecov
Copy link

codecov bot commented Apr 13, 2020

Codecov Report

Merging #23 into master will increase coverage by 0.19%.
The diff coverage is 97.89%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #23      +/-   ##
==========================================
+ Coverage   96.94%   97.14%   +0.19%     
==========================================
  Files          34       38       +4     
  Lines        1638     2066     +428     
==========================================
+ Hits         1588     2007     +419     
- Misses         50       59       +9     
Impacted Files Coverage Δ
Sources/Subjects/ReplaySubject.swift 82.35% <82.35%> (ø)
Sources/Operators/ShareReplay.swift 100.00% <100.00%> (ø)
Tests/ReplaySubjectTests.swift 100.00% <100.00%> (ø)
Tests/ShareReplayTests.swift 100.00% <100.00%> (ø)

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 ad2aef2...08836e2. Read the comment docs.

@jasdev jasdev marked this pull request as ready for review April 13, 2020 21:42
@jasdev jasdev changed the title Adds ReplaySubject and Publisher.share(replay). Adds ReplaySubject and Publisher.share(replay:). Apr 13, 2020
@tcldr
Copy link

tcldr commented Apr 13, 2020

h/t to @tcldr for the reference implementation I leaned on and adapted to Shai’s Sink type. 💯

Glad it’s been useful! 👍

Copy link
Member

@freak4pc freak4pc left a comment

Choose a reason for hiding this comment

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

I didn't go over the tests yet, I'll do that later locally,
Most of the notes are just formatting, nothing logic-wise except 1 question

Great work! 👏

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
Sources/Operators/ShareReplay.swift Outdated Show resolved Hide resolved
Sources/Subjects/ReplaySubject.swift Outdated Show resolved Hide resolved
Sources/Subjects/ReplaySubject.swift Outdated Show resolved Hide resolved
Sources/Subjects/ReplaySubject.swift Outdated Show resolved Hide resolved
Sources/Subjects/ReplaySubject.swift Outdated Show resolved Hide resolved
Tests/ReplaySubjectTests.swift Outdated Show resolved Hide resolved
@jasdev jasdev requested a review from freak4pc April 19, 2020 00:53
@jasdev
Copy link
Member Author

jasdev commented Apr 19, 2020

Should be good for another pass over, thanks for the thorough review, Shai. 🙏🏽

Copy link
Member

@freak4pc freak4pc left a comment

Choose a reason for hiding this comment

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

Second pass, this should be everything I have in mind ;)
Sorry for the lengthy review but this is a big piece of code with 2 very useful features :) Thanks!

Sources/Operators/ShareReplay.swift Outdated Show resolved Hide resolved
Sources/Operators/ShareReplay.swift Outdated Show resolved Hide resolved
Sources/Operators/ShareReplay.swift Show resolved Hide resolved
Sources/Subjects/ReplaySubject.swift Outdated Show resolved Hide resolved
Sources/Subjects/ReplaySubject.swift Outdated Show resolved Hide resolved
Tests/ReplaySubjectTests.swift Outdated Show resolved Hide resolved
Tests/ShareReplayTests.swift Outdated Show resolved Hide resolved
Sources/Subjects/ReplaySubject.swift Outdated Show resolved Hide resolved
Sources/Subjects/ReplaySubject.swift Outdated Show resolved Hide resolved
Sources/Subjects/ReplaySubject.swift Outdated Show resolved Hide resolved
@jasdev
Copy link
Member Author

jasdev commented Apr 19, 2020

Aaand round-two feedback incorporated. 🤞🏽

Thanks again for the reads over this!

@jasdev jasdev requested a review from freak4pc April 19, 2020 20:09
@jasdev jasdev changed the title Adds ReplaySubject and Publisher.share(replay:). Adds ReplaySubject and Publisher.share(replay:). Apr 19, 2020
Copy link
Member

@freak4pc freak4pc left a comment

Choose a reason for hiding this comment

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

Last note!!

Sources/Subjects/ReplaySubject.swift Outdated Show resolved Hide resolved
Tests/ReplaySubjectTests.swift Outdated Show resolved Hide resolved
@jasdev jasdev requested a review from freak4pc April 19, 2020 20:26
Copy link
Member

@freak4pc freak4pc left a comment

Choose a reason for hiding this comment

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

image

@freak4pc freak4pc changed the title Adds ReplaySubject and Publisher.share(replay:). Adds ReplaySubject and Publisher.share(replay:) Apr 19, 2020
@freak4pc freak4pc merged commit 6e65aba into CombineCommunity:master Apr 19, 2020
@jasdev jasdev deleted the share-replay branch April 19, 2020 20:40
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.

3 participants