# waitForResourceStates

- 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 one of the specified states

## Definition

```typescript
interface ResourceNotificationService {
  // ... omitted for brevity
  waitForResourceStates(
    resourceName: string,
    targetStates: string[]): string
}
```

## Parameters

- `resourceName` (`string`)
- `targetStates` (`string[]`)

## Returns

`string`

## Applies to

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