# Class: RenderTask

## RenderTask

#### new RenderTask()

Allows controlling of the rendering tasks.

Source:
  - display/api.js, line 2054

### Members

#### promise

Promise for rendering task completion.

Source:
  - display/api.js, line 2072

### Methods

#### cancel()

Cancels the rendering task. If the task is currently rendering it will not be cancelled until graphics pauses with a timeout. The promise that this object extends will be rejected when cancelled.

Source:
  - display/api.js, line 2081

#### then(onFulfilled, onRejected) → {Promise}

Registers callbacks to indicate the rendering task completion.

##### Parameters:

Name | Type | Description
--- | --- | ---
`onFulfilled` | function | The callback for the rendering completion.
`onRejected` | function | The callback for the rendering failure.

Source:
  - display/api.js, line 2093

##### Returns:

A promise that is resolved after the onFulfilled or onRejected callback.

Type
  Promise