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

Support iteration in builtin SharedRepository implementations #81

Merged
merged 2 commits into from
Aug 21, 2023

Conversation

Supereg
Copy link
Member

@Supereg Supereg commented Aug 10, 2023

Support iteration in builtin SharedRepository implementations

♻️ Current situation & Problem

Currently, we have no ability to access the elements in our built in shared repositories in a type-erased way. Specifically, we have no way to iterate over them.

💡 Proposed solution

This PR addresses this issue by adding Collection conformance for our two builtin Shared Repository types and extending the AnyRepositoryValue type.

⚙️ Release Notes

  • Add Collection conformance to our build in shared repositories.

➕ Additional Information

Related PRs

This feature will be useful in StanfordSpezi/SpeziAccount#7 for a Account Service to process modified account details.

Testing

Additionally unit tests were included.

Reviewer Nudging

--

Code of Conduct & Contributing Guidelines

By submitting creating this pull request, you agree to follow our Code of Conduct and Contributing Guidelines:

@codecov
Copy link

codecov bot commented Aug 10, 2023

Codecov Report

Merging #81 (85c98c0) into main (9ad506d) will increase coverage by 0.11%.
The diff coverage is 100.00%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #81      +/-   ##
==========================================
+ Coverage   97.52%   97.63%   +0.11%     
==========================================
  Files          34       34              
  Lines         604      631      +27     
==========================================
+ Hits          589      616      +27     
  Misses         15       15              
Files Changed Coverage Δ
...pezi/SharedRepository/Builtin/HeapRepository.swift 100.00% <100.00%> (ø)
...ezi/SharedRepository/Builtin/ValueRepository.swift 100.00% <100.00%> (ø)
...urces/Spezi/SharedRepository/RepositoryValue.swift 100.00% <100.00%> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9ad506d...85c98c0. Read the comment docs.

Copy link
Member

@PSchmiedmayer PSchmiedmayer left a comment

Choose a reason for hiding this comment

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

Looks good, thank you @Supereg! 🚀

@Supereg Supereg marked this pull request as draft August 15, 2023 17:32
@Supereg Supereg marked this pull request as ready for review August 21, 2023 20:45
@Supereg Supereg merged commit 7462510 into main Aug 21, 2023
9 checks passed
@Supereg Supereg deleted the feature/shared-repository-iteration branch August 21, 2023 20:46
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