How to convert Just<[Int]>
to AnyPublisher<[Int], Error>
. When I use eraseToAnyPublisher()
the type is AnyPublisher<[Int], Never>
which is not the same as AnyPublisher<[Int], Error>
For example I have a simple function which I want to mock temporary
func getAllIds() -> AnyPublisher<[Int], Error> {
return Just<[Int]>([]).eraseToAnyPublisher()
}
Any ideas?