Skip to content

0.7.0

Compare
Choose a tag to compare
@0xLeif 0xLeif released this 18 Aug 03:47
· 27 commits to main since this release
78dfa23

What's Changed

  • Add async map and filter to array by @0xLeif in #10

Full Changelog: 0.6.3...0.7.0

ForkedArray Examples

let photoNames: [String] = ...
func isValidPhoto(named: String) async -> Bool { ... }
func downloadPhoto(named: String) async -> Photo { ... }

ForkedArray init

let forkedArray: ForkedArray<String, Photo> = ForkedArray(
    photoNames,
    filter: isValidPhoto(named:),
    map: downloadPhoto(named:)
)
let photos: [Photo] = try await forkedArray.output()

Array ForkedArray init

let forkedArray = photoNames.fork
    filter: isValidPhoto(named:),
    map: downloadPhoto(named:)
)
let photos: [Photo] = try await forkedArray.output()

Array asyncFilter

let photoNames: [String] = try await photoNames.asyncFilter(isValidPhoto(named:))

Array asyncMap

let photos: [Photo] = try await photoNames.asyncMap(downloadPhoto(named:))