func f1() -> any Publisher<.Output == Int> { if 何か条件1 { return Just(1) } if 何か条件2 { return Just(2) } return Fail(error: someError) }
anyPublisher
AnyPublisher<Int, Error>