Skip to content

Instantly share code, notes, and snippets.

View yosshi4486's full-sized avatar

yosshi4486 yosshi4486

View GitHub Profile
@yosshi4486
yosshi4486 / CustomOperatorSample.swift
Last active March 22, 2020 07:37
Make custom operator without subscription for Combine.
import Combine
public struct Double<Upstream,Output>: Publisher where Upstream:Publisher, Output : Numeric, Upstream.Output == Output {
public typealias Failure = Upstream.Failure
/// The upstream publisher.
public let upstream: Upstream
public init(upstream: Upstream) {
self.upstream = upstream