# waitForResourceState

- Module: [Aspire.Hosting](/reference/api/typescript/aspire.hosting.md)
- Version: `13.2.0`
- Kind: `method`
- Source: [GitHub](https://github.com/microsoft/aspire)

Waits for a resource to reach a specified state

## Definition

```typescript
interface ResourceNotificationService {
  // ... omitted for brevity
  waitForResourceState(
    resourceName: string,
    targetState?: string): void
}
```

## Parameters

- `resourceName` (`string`)
- `targetState` (`string`) `optional`

## Applies to

- [ResourceNotificationService](/reference/api/typescript/aspire.hosting/resourcenotificationservice.md)
