---
url: https://lit-ui-router.dev/api/ui-router-effect/functions/pendingRef.md
---
[ui-router-effect](../index.md) / pendingRef

# Function: pendingRef()

```ts
function pendingRef(router): SubscriptionRef<
  | Transition
| undefined>;
```

Defined in: [ui-router-effect/src/transition-refs.ts:63](https://github.com/simshanith/lit-ui-router/blob/6dc5fbe271a6dce8c4782b4130e03af86a9ff82d/packages/ui-router-effect/src/transition-refs.ts#L63)

The pending-transition ref for a router — one per router instance,
attached lazily.

It holds the newest transition still in flight, and `undefined` when none
is. The first caller of this or [errorRef](errorRef.md) creates both refs and
registers the single `onStart` hook that feeds them; the transition's
promise clears it when that transition settles, whether it succeeds,
errors or is aborted, unless a newer one has started. A transition already
running on first use counts as pending. Kept out of `RouteSnapshot`, whose
every value is a settled route.

## Parameters

| Parameter | Type |
| ------ | ------ |
| `router` | [`UIRouter`](https://ui-router.github.io/core/docs/latest/classes/_router_.uirouter.html) |

## Returns

[`SubscriptionRef`](https://effect.website/docs/state-management/subscriptionref/)<
| [`Transition`](https://ui-router.github.io/core/docs/latest/classes/_transition_transition_.transition.html)
| `undefined`>
