ObservableK

public final class ObservableK<A> : ObservableKOf<A>

ObservableK is a Higher Kinded Type wrapper over RxSwift’s Observable data type.

  • Wrapped Observable value.

    Declaration

    Swift

    public let value: Observable<A>
  • Safe downcast.

    Declaration

    Swift

    public static func fix(_ value: ObservableKOf<A>) -> ObservableK<A>

    Parameters

    value

    Value in the higher-kind form.

    Return Value

    Value cast to ObservableK.

  • Provides an empty ObservableK.

    Declaration

    Swift

    public static func empty() -> ObservableK<A>

    Return Value

    An ObservableK that does not provide any value.

  • Creates an ObservableK from the result of evaluating a function, suspending its execution.

    Declaration

    Swift

    public static func from(_ f: @escaping () throws -> A) -> ObservableK<A>

    Parameters

    f

    Function providing the value to be provided in the underlying Observable.

    Return Value

    An ObservableK that provides the value obtained from the closure.

  • Creates an ObservableK from the result of evaluating a function, suspending its execution.

    Declaration

    Swift

    public static func invoke(_ f: @escaping () throws -> ObservableKOf<A>) -> ObservableK<A>

    Parameters

    f

    Function providing the value to be provided in the underlying Observable.

    Return Value

    An ObservableK that provides the value obtained from the closure.

  • Initializes a value of this type with the underlying Observable value.

    Declaration

    Swift

    public init(_ value: Observable<A>)

    Parameters

    value

    Wrapped Observable value.

  • Wrapper over Observable.concatMap(_:).

    Declaration

    Swift

    public func concatMap<B>(_ f: @escaping (A) -> ObservableKOf<B>) -> ObservableK<B>

    Parameters

    f

    Function to be mapped.

    Return Value

    An ObservableK resulting from the application of the function.