Options
All
  • Public
  • Public/Protected
  • All
Menu

Pool

Represents a pool of time in which things (represented by drops) might happen.

Hierarchy

Index

Constructors

constructor

  • new Pool(__namedParameters: object): Pool
  • Parameters

    • __namedParameters: object
      • dropCount: number | function

        Number of times this Pool will drop. If function, it will be called each time the Pool starts to determine how many times the current run will drop.

      • dropDistributionWeight: number | function

        Distribution of drops within the pool: 1 = neutral, lower = later, higher = earlier. Uses weightedRandom under the hood.

      • duration: number | function

        Duration of this pool (ms). If function, it will be called each time the Pool starts to determine how long the currnt run will last.

      • loop: boolean

        Whether this Pool will loop.

    Returns Pool

Properties

destroy$

destroy$: Observable<void>

Fires when the Pool stops and is not looping.

drop$

drop$: Observable<number>

Fires for each drop in the Pool. Callback is passed the drop index.

dropCount

dropCount: number

The number of times the present run will drop.

dropDistributionWeight

dropDistributionWeight: number = 1

The distribution weighting for drops in the Pool * (1 = neutral, lower = later, higher = earlier). Uses weightedRandom under the hood.

NB: This will be changed to use a distribution function in future versions.

duration

duration: number

Total duration of the current iteration of the pool (ms).

loop

loop: boolean = false

Whether the Pool should restart when it ends.

pause$

pause$: Observable<void>

Fires when the Pool is paused.

resume$

resume$: Observable<void>

Fires when the Pool is resumed.

start$

start$: Observable<void>

Fires at the start of a Pool cycle.

stop$

stop$: Observable<void>

Fires at the end of a Pool cycle.

Methods

pause

  • pause(): void
  • Pauses the Pool.

    Returns void

resume

  • resume(): void
  • Resumes the Pool.

    Returns void

start

  • start(): void
  • Starts the pool.

    Returns void

stop

  • stop(): void
  • Stops and resets the pool.

    Returns void

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc