Skip to content

Adds Collection.flatMapBatches(of:). - #73

Merged
freak4pc merged 2 commits into
CombineCommunity:mainfrom
jasdev:jasdev/batched-subscribe
Mar 6, 2021
Merged

freak4pc merged 2 commits into
CombineCommunity:mainfrom
jasdev:jasdev/batched-subscribe

Conversation

@jasdev

@jasdev jasdev commented Jan 24, 2021

Copy link
Copy Markdown
Member

h/t @freak4pc and @natecook1000 for this implementation from a thread in iOS Folks. 👏🏽

@codecov

codecov Bot commented Jan 24, 2021 •

Copy link
Copy Markdown

Codecov Report

Merging #73 (d676f36) into main (0605a06) will increase coverage by 0.09%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #73      +/-   ##
==========================================
+ Coverage   96.91%   97.01%   +0.09%     
==========================================
  Files          58       60       +2     
  Lines        3114     3215     +101     
==========================================
+ Hits         3018     3119     +101     
  Misses         96       96              
Impacted Files Coverage Δ
Sources/Operators/FlatMapBatches.swift 100.00% <100.00%> (ø)
Tests/FlatMapBatchesTests.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 0605a06...7e0f0c7. Read the comment docs.

@jasdev jasdev changed the title Adds Collection.batchedSubscribe(by:). Adds Collection.batchedSubscribe(by:). Jan 24, 2021
@freak4pc

Copy link
Copy Markdown
Member

Thanks for putting this together! I'm having a hard time with the name though :) Got any other ideas?

@jasdev

jasdev commented Jan 26, 2021 •

Copy link
Copy Markdown
Member Author

How’s Collection.batchedPublisher(by:) to better align with the .publisher property convention?

@freak4pc

freak4pc commented Mar 2, 2021

Copy link
Copy Markdown
Member

What about flatMapBatches(of size: Int) ?

@jasdev

jasdev commented Mar 2, 2021

Copy link
Copy Markdown
Member Author

@freak4pc, done and done. ✅

@jasdev jasdev changed the title Adds Collection.batchedSubscribe(by:). Adds Collection.flatMapBatches(of:). Mar 2, 2021

@freak4pc freak4pc left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Love it. Thank you so much!

Comment on lines +30 to +33
$0 == endIndex ?
nil :
index($0, offsetBy: size, limitedBy: endIndex)
?? endIndex

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is the Apple foundation team voodoo alright! 😂

@freak4pc
freak4pc merged commit bfc1a02 into CombineCommunity:main Mar 6, 2021
@jasdev
jasdev deleted the jasdev/batched-subscribe branch March 6, 2021 19:52
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.

2 participants