Add Guide for parallel processing in DataStore on iOS - #3236
Conversation
|
One suggestion - maybe we use a different phrase other than "batch" for this guide? Batch terminology is something very specific with DynamoDB and I fear customers will get confused. |
I second this. Even outside of the DynamoDB scenarios, batching has deeper implications, It think what it's happening in this PR is more about parallel processing than batching. |
|
I like the "in parallel" phrasing change and think this looks valuable, I'd love to hear more from some iOS focused folks on the team too. |
palpatim
left a comment
There was a problem hiding this comment.
Very cool guide, and I also learned more about Combine. :) Minor notes below, but LGTM
| Todo(name: "Profit") | ||
| ] | ||
|
|
||
| let sink = Publishers.Sequence<[Todo], Never>(sequence: todos) |
There was a problem hiding this comment.
Here and below: can simplify this to todos.publisher
| } | ||
| ``` | ||
|
|
||
| `Publishers.Sequence` creates a `Publisher` where each model is passed to `.flatMap()` individually, allowing for each object to be saved to DataStore. `.collect()` emits a single array of all the elements collected, returning the saved models in `receiveValue`. |
There was a problem hiding this comment.
"todos.publisher creates a ..."
Issue #, if available:
N/A
Description of changes:
Added a Guide that shows user how to perform batch CRUD operations using Combine for iOS. New section named "DataStore" was also added to the Guides.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.