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

Add a 'compactMap'-Function to 'LoadableState' #8

Closed
tinora opened this issue Feb 29, 2024 · 1 comment
Closed

Add a 'compactMap'-Function to 'LoadableState' #8

tinora opened this issue Feb 29, 2024 · 1 comment

Comments

@tinora
Copy link

tinora commented Feb 29, 2024

A 'compactMap'-Function would help with scenarios like transforming an array of entries to a single entry where it is not sure whether the desired specific entry is really in the array of entries.

Assume a loadable list of points of interests:

`var pois: LoableState<[POI]>

var aPOI: LoadableState {
pois.compactMap { pois in
pois.first { $0.id == poiId }
}
}
`
This scenario comes up with respect to deep linking for instance.

tinora pushed a commit to tinora/Processed that referenced this issue Feb 29, 2024
SwiftedMind added a commit that referenced this issue Feb 29, 2024
#8 add a compactMap function
@SwiftedMind
Copy link
Owner

Nice, thanks 👍

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

No branches or pull requests

2 participants