Skip to content

Instantly share code, notes, and snippets.

View cjndubisi's full-sized avatar
👋

Chijioke Ndubisi cjndubisi

👋
View GitHub Profile
@zarghol
zarghol / combine+delegate.swift
Created November 25, 2019 12:30
Combine+Pattern Delegate
import Foundation
import Combine
import CoreLocation
extension Subscriber {
func eraseToAnySubscriber() -> AnySubscriber<Self.Input, Self.Failure> {
return AnySubscriber<Input, Failure>.init(receiveSubscription: { sub in
self.receive(subscription: sub)
}, receiveValue: { value in
self.receive(value)
type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
export function withAppContext<
P extends { appContext?: AppContextInterface },
R = Omit<P, 'appContext'>
>(
Component: React.ComponentClass<P> | React.StatelessComponent<P>
): React.SFC<R> {
return function BoundComponent(props: R) {
return (