Skip to main content

Class: HatAllocator

core/HatAllocator.HatAllocator

Constructors

constructor

new HatAllocator(graph, context)

Parameters

NameType
graphGraph
contextContext

Defined in

core/HatAllocator.ts:17

Properties

disposables

Private disposables: Disposable[] = []

Defined in

core/HatAllocator.ts:15


timeoutHandle

Private timeoutHandle: null | Timeout = null

Defined in

core/HatAllocator.ts:14

Methods

allocateHats

allocateHats(oldTokenHats?): Promise<void>

Allocate hats to the visible tokens.

Parameters

NameTypeDescription
oldTokenHats?TokenHat[]If supplied, pretend that this allocation was the previous allocation when trying to maintain stable hats. This parameter is used for testing.

Returns

Promise<void>

Defined in

core/HatAllocator.ts:55


allocateHatsDebounced

allocateHatsDebounced(): void

Returns

void

Defined in

core/HatAllocator.ts:80


dispose

dispose(): void

Returns

void

Defined in

core/HatAllocator.ts:95