Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Future<A>

A future is a thing that occurs at some point in time with a value. It can be understood as a pair consisting of the time the future occurs and its associated value. It is quite like a JavaScript promise.

Type parameters

  • A

Hierarchy

Implements

Index

Constructors

constructor

Properties

Protected listeners

listeners: Consumer<A>[]

occured

occured: boolean

value

value: A

Methods

chain

  • chain<B>(f: function): Future<B>

listen

map

  • map<B>(f: function): Future<B>
  • Type parameters

    • B

    Parameters

    • f: function
        • (a: A): B
        • Parameters

          • a: A

          Returns B

    Returns Future<B>

mapTo

of

push

  • push(val: any): void

resolve

  • resolve(val: A): void

subscribe

  • subscribe(f: function): void
  • Parameters

    • f: function
        • (a: A): void
        • Parameters

          • a: A

          Returns void

    Returns void

Static lift

  • Type parameters

    • T1

    • R

    Parameters

    • f: function
        • (t: T1): R
        • Parameters

          • t: T1

          Returns R

    • m: Future<T1>

    Returns Future<R>

  • Type parameters

    • T1

    • T2

    • R

    Parameters

    • f: function
        • (t: T1, u: T2): R
        • Parameters

          • t: T1
          • u: T2

          Returns R

    • m1: Future<T1>
    • m2: Future<T2>

    Returns Future<R>

  • Type parameters

    • T1

    • T2

    • T3

    • R

    Parameters

    • f: function
        • (t1: T1, t2: T2, t3: T3): R
        • Parameters

          • t1: T1
          • t2: T2
          • t3: T3

          Returns R

    • m1: Future<T1>
    • m2: Future<T2>
    • m3: Future<T3>

    Returns Future<R>

Static of

Generated using TypeDoc