---
name: "up.RenderJob.prototype.then"
area: "API"
kind: "Instance method"
parent: "up.RenderJob class"
url: "https://unpoly.com/api/up.RenderJob.prototype.then"
---
<nav aria-label="Unpoly docs">[All docs](https://unpoly.com/index.md) · [up.RenderJob class](https://unpoly.com/api/up.RenderJob.md)</nav>

# up.RenderJob.prototype.then(onFulfilled, onRejected)

An [`up.RenderJob`](https://unpoly.com/api/up.RenderJob.md) is also a promise for its completion.

The promise is _fulfilled_ with an [`up.RenderResult`](https://unpoly.com/api/up.RenderResult.md) when a fragment was updated from a successful server response.

The promise will _reject_ for responses with an [HTTP error status](https://unpoly.com/learn/error-responses.md), when the request is [aborted](https://unpoly.com/learn/aborting-requests.md), or when there is a [network issue](https://unpoly.com/learn/network-issues.md).

See [render hooks](https://unpoly.com/learn/render-lifecycle.md) for examples of awaiting rendering completion and how to handle errors.

---

## Parameters {#parameters}

### onFulfilled {#onFulfilled}

(required)

Type: Function([up.RenderResult](https://unpoly.com/api/up.RenderResult.md))

### onRejected {#onRejected}

(required)

Type: Function([up.RenderResult](https://unpoly.com/api/up.RenderResult.md)|[Error](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error))

---

## Return value {#return-value}

A promise that fulfills with an [`up.RenderResult`](https://unpoly.com/api/up.RenderResult.md) once the page has been updated.

Type: [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises)<[up.RenderResult](https://unpoly.com/api/up.RenderResult.md)>

