I have this function
import Foundation
import Combine
import Amplify
func fetchCurrentAuthSession() -> AnyCancellable {
Amplify.Auth.fetchAuthSession().resultPublisher
.sink {
if case let .failure(authError) = $0 {
print("Fetch session failed with error \(authError)")
}
}
receiveValue: { session in
print("Is user signed in - \(session.isSignedIn)")
}
}
and I am calling it like this
Button(action: {
print("button pressed")
fetchCurrentAuthSession()
}) {
Text("Authenticated Test")
}
I get the Xcode warning Result of call to 'fetchCurrentAuthSession()' is unused
its not clear to me what the "result of the call" is, or how I should be "using it"