Link Search Menu Expand Document

Observable overview

Added in v0.6.0


Table of contents


Alt

alt

Identifies an associative operation on a type constructor. It is similar to Semigroup, except that it applies to types of kind * -> *.

Signature

export declare const alt: <A>(that: () => Observable<A>) => (fa: Observable<A>) => Observable<A>

Added in v0.6.0

Alternative

zero

Signature

export declare const zero: <A>() => Observable<A>

Added in v0.6.12

Applicative

of

Signature

export declare const of: <A>(a: A) => Observable<A>

Added in v0.6.6

Apply

ap

Apply a function to an argument under a type constructor.

Signature

export declare const ap: <A>(fa: Observable<A>) => <B>(fab: Observable<(a: A) => B>) => Observable<B>

Added in v0.6.0

Compactable

compact

Signature

export declare const compact: <A>(fa: Observable<O.Option<A>>) => Observable<A>

Added in v0.6.0

separate

Signature

export declare const separate: <A, B>(fa: Observable<E.Either<A, B>>) => Separated<Observable<A>, Observable<B>>

Added in v0.6.0

Filterable

filter

Signature

export declare const filter: {
  <A, B extends A>(refinement: Refinement<A, B>): (fa: Observable<A>) => Observable<B>
  <A>(predicate: Predicate<A>): (fa: Observable<A>) => Observable<A>
}

Added in v0.6.0

filterMap

Signature

export declare const filterMap: <A, B>(f: (a: A) => O.Option<B>) => (fa: Observable<A>) => Observable<B>

Added in v0.6.0

partition

Signature

export declare const partition: {
  <A, B extends A>(refinement: Refinement<A, B>): (fa: Observable<A>) => Separated<Observable<A>, Observable<B>>
  <A>(predicate: Predicate<A>): (fa: Observable<A>) => Separated<Observable<A>, Observable<A>>
}

Added in v0.6.0

partitionMap

Signature

export declare const partitionMap: <A, B, C>(
  f: (a: A) => E.Either<B, C>
) => (fa: Observable<A>) => Separated<Observable<B>, Observable<C>>

Added in v0.6.0

Functor

map

map can be used to turn functions (a: A) => B into functions (fa: F<A>) => F<B> whose argument and return types use the type constructor F to represent some computational context.

Signature

export declare const map: <A, B>(f: (a: A) => B) => (fa: Observable<A>) => Observable<B>

Added in v0.6.0

Monad

chain

Composes computations in sequence, using the return value of one computation to determine the next computation.

Signature

export declare const chain: <A, B>(f: (a: A) => Observable<B>) => (ma: Observable<A>) => Observable<B>

Added in v0.6.0

combinators

apFirst

Combine two effectful actions, keeping only the result of the first.

Derivable from Apply.

Signature

export declare const apFirst: <B>(fb: Observable<B>) => <A>(fa: Observable<A>) => Observable<A>

Added in v0.6.0

apSecond

Combine two effectful actions, keeping only the result of the second.

Derivable from Apply.

Signature

export declare const apSecond: <B>(fb: Observable<B>) => <A>(fa: Observable<A>) => Observable<B>

Added in v0.6.0

chainFirst

Composes computations in sequence, using the return value of one computation to determine the next computation and keeping only the result of the first.

Derivable from Monad.

Signature

export declare const chainFirst: <A, B>(f: (a: A) => Observable<B>) => (ma: Observable<A>) => Observable<A>

Added in v0.6.0

flatten

Derivable from Monad.

Signature

export declare const flatten: <A>(mma: Observable<Observable<A>>) => Observable<A>

Added in v0.6.0

constructors

fromIO

Signature

export declare const fromIO: <A>(fa: IO<A>) => Observable<A>

Added in v0.6.5

fromOption

Signature

export declare const fromOption: <A>(o: O.Option<A>) => Observable<A>

Added in v0.6.5

fromTask

Signature

export declare const fromTask: <A>(fa: Task<A>) => Observable<A>

Added in v0.6.5

instances

Alt

Signature

export declare const Alt: Alt1<'Observable'>

Added in v0.6.12

Alternative

Signature

export declare const Alternative: Alternative1<'Observable'>

Added in v0.6.12

Applicative

Signature

export declare const Applicative: Applicative1<'Observable'>

Added in v0.6.12

Apply

Signature

export declare const Apply: Apply1<'Observable'>

Added in v0.6.12

Compactable

Signature

export declare const Compactable: Compactable1<'Observable'>

Added in v0.6.12

Filterable

Signature

export declare const Filterable: Filterable1<'Observable'>

Added in v0.6.12

Functor

Signature

export declare const Functor: Functor1<'Observable'>

Added in v0.6.12

Monad

Signature

export declare const Monad: Monad1<'Observable'>

Added in v0.6.12

MonadIO

Signature

export declare const MonadIO: MonadIO1<'Observable'>

Added in v0.6.12

MonadObservable

Signature

export declare const MonadObservable: MonadObservable1<'Observable'>

Added in v0.6.12

MonadTask

Signature

export declare const MonadTask: MonadTask1<'Observable'>

Added in v0.6.12

URI

Signature

export declare const URI: 'Observable'

Added in v0.6.0

URI (type alias)

Signature

export type URI = typeof URI

Added in v0.6.0

getMonoid

Signature

export declare const getMonoid: <A = never>() => Monoid<Observable<A>>

Added in v0.6.0

observable

Signature

export declare const observable: Monad1<'Observable'> &
  Alternative1<'Observable'> &
  Filterable1<'Observable'> &
  MonadObservable1<'Observable'>

Added in v0.6.0

utils

Do

Signature

export declare const Do: Observable<{}>

Added in v0.6.12

bind

Signature

export declare const bind: <K extends string, A, B>(
  name: Exclude<K, keyof A>,
  f: (a: A) => Observable<B>
) => (fa: Observable<A>) => Observable<{ [P in K | keyof A]: P extends keyof A ? A[P] : B }>

Added in v0.6.11

bindTo

Signature

export declare const bindTo: <K extends string, A>(name: K) => (fa: Observable<A>) => Observable<{ [P in K]: A }>

Added in v0.6.11

toTask

Signature

export declare const toTask: <A>(o: Observable<A>) => Task<A>

Added in v0.6.5

toTaskOption

Signature

export declare const toTaskOption: <A>(o: Observable<A>) => Task<O.Option<A>>

Added in v0.6.15