blob: b82507ba231ad9c9e6da5f30172c1bc4d5313982 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
//
// RelaySelector+RelayCache.swift
// MullvadVPN
//
// Created by pronebird on 07/11/2019.
// Copyright © 2019 Amagicom AB. All rights reserved.
//
import Combine
import Foundation
extension RelaySelector {
static func loadedFromRelayCache() -> AnyPublisher<RelaySelector, RelayCacheError> {
return RelayCache.withDefaultLocation().publisher
.flatMap { $0.read() }
.map { RelaySelector(relayList: $0.relayList) }
.eraseToAnyPublisher()
}
}
|