Learn Courses My Dashboard

I appreciate can any one resolve the issue, The Sink subscriber could not obtain or receive results

var disposables = Set()

init() {

    $offset
        .debounce(for:.seconds(0.5), scheduler: DispatchQueue.main)
        .removeDuplicates()
        .tryMap {[weak self] (offsetValue) -> AnyPublisher<ApprovalService.ApprovalQueryResult, Error> in
            
            guard let strongSelf = self else {
                return Empty<ApprovalService.ApprovalQueryResult, Error>().eraseToAnyPublisher()
            }
            
            return strongSelf.approvalService.getAssignedApprovals(count: AssignedApprovalsByRequestViewModel.increment, offset: offsetValue).eraseToAnyPublisher()
        }.switchToLatest()
        .catch { [weak self] (error: Error) -> Empty <ApprovalService.ApprovalQueryResult, Never> in
            self?.assignedApprovalListError = error
            return Empty<ApprovalService.ApprovalQueryResult, Never>()
        }
        .map {
            self.totalCount = $0.totalCount
            return $0.result.publisher
        }
        .switchToLatest()
        .reduce([Request]()) { (parentRequests: [Request], approvalToSort: Approval) -> [Request] in
            guard let request = approvalToSort.request else {
                return parentRequests
            }
            
            if let requestIndex = parentRequests.firstIndex(of: request) {
                let request = parentRequests[requestIndex]
                request.approvals!.append(approvalToSort)
                print("parentRequests is: \(parentRequests)")
                return parentRequests
            } else {
                request.approvals = [approvalToSort]
                print("parentRequests + [request] is: \(parentRequests + [request])")
                return parentRequests + [request]
            }
        }
               
        .sink(receiveValue: { results in
            print("reqValue \(results)")
        })
       
        .store(in: &disposables)
}