Skip to content

Commit

Permalink
use compactMap to drop the nil values
Browse files Browse the repository at this point in the history
  • Loading branch information
vahidlazio committed Jan 23, 2024
1 parent 35eec9a commit 1d8cec8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Sources/OpenFeature/OpenFeatureAPI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ public class OpenFeatureAPI {

public func observe() -> any Publisher<ProviderEvent, Never> {
return providerSubject

Check warning on line 77 in Sources/OpenFeature/OpenFeatureAPI.swift

View workflow job for this annotation

GitHub Actions / SwiftLint

Trailing Closure Violation: Trailing closure syntax should be used whenever possible (trailing_closure)
.filter({provider in provider != nil})
.map({ provider in provider!.observe()})
.compactMap{ $0 }

Check warning on line 78 in Sources/OpenFeature/OpenFeatureAPI.swift

View workflow job for this annotation

GitHub Actions / SwiftLint

Closure Spacing Violation: Closure expressions should have a single space inside each brace (closure_spacing)
.map({ provider in provider.observe()})

Check warning on line 79 in Sources/OpenFeature/OpenFeatureAPI.swift

View workflow job for this annotation

GitHub Actions / SwiftLint

Closure Spacing Violation: Closure expressions should have a single space inside each brace (closure_spacing)
.switchToLatest()
}

Expand Down

0 comments on commit 1d8cec8

Please sign in to comment.