```swift
func signOutLocally() {
Amplify.Auth.signOut() { result in
switch result {
case .success:
print("Successfully signed out")
case .failure(let error):
print("Sign out failed with error \(error)")
}
}
}
```
```swift
func signOutLocally() -> AnyCancellable {
Amplify.Auth.signOut()
.resultPublisher
.sink {
if case let .failure(authError) = $0 {
print("Sign out failed with error \(authError)")
}
}
receiveValue: {
print("Successfully signed out")
}
}
```