     @discardableResult
     func startUpdatingLocation(enableBackground: Bool = false) -> AnyPublisher<CLLocation, CLError> {
         service.startUpdatingLocation(enableBackground: enableBackground)
-        return locationPublisher
+        return publisher()
     }
 
     /// Stops the generation of location updates.

            // Notify in case authorization dialog not launched by OS
            // since user will be notified first time only and ignored subsequently
            Self.authorizationSubject.send(false)
            return authorizationPublisher
        }

        // Handle denied and exit
        guard service.canRequestAuthorization else {
            Self.authorizationSubject.send(false)
            return authorizationPublisher
        }

        return authorizationPublisher
    }
}


        #endif
    }
}

// MARK: - Observables

public extension LocationManager {
    private static let authorizationSubject = CurrentValueSubject<Bool?, Never>(nil)
    private static let locationSubject = CurrentValueSubject<CLLocation?, CLError>(nil)
    #if os(iOS)
    private static let headingSubject = CurrentValueSubject<CLHeading?, CLError>(nil)
    #endif

    func publisher() -> AnyPublisher<Bool, Never> {
        Self.authorizationSubject
            .compactMap { $0 }
            .eraseToAnyPublisher()
    }

    func publisher() -> AnyPublisher<CLLocation, CLError> {
        Self.locationSubject
            .compactMap { $0 }
            .eraseToAnyPublisher()
    }

    #if os(iOS)
    func publisher() -> AnyPublisher<CLHeading, CLError> {
        Self.headingSubject
            .compactMap { $0 }
            .eraseToAnyPublisher()
    }
    #endif
}
