# AbstractModelWithAsyncData

**Kind:** Class

Abstract superclass for all Blocks SDK models that need to fetch async data.

## Properties

### `id`

Type: `string`

The ID for this model.

### `isDataLoaded`

Type: `boolean`

### `isDeleted`

Type: `boolean`

## Methods

### `loadDataAsync()`

Will cause all the async data to be fetched and retained. Every call to
`loadDataAsync` should have a matching call to `unloadData`.

Returns a Promise that will resolve once the data is loaded.

**Returns:** `Promise<void>`

### `toString()`

A string representation of the model for use in debugging.

**Returns:** `string`

### `unloadData()`

**Returns:** `void`

### `unwatch(keys, callback, context?)`

Unwatching a key that needs to load data asynchronously will automatically
cause the data to be released. Once the data is available, the callback
will be called.

**Parameters:**
- `keys` (`WatchableKey | ReadonlyArray<WatchableKey>`)
- `callback` (`FlowAnyFunction`)
- `context?` (`FlowAnyObject | null`)

**Returns:** `Array<WatchableKey>`

### `watch(keys, callback, context?)`

Watching a key that needs to load data asynchronously will automatically
cause the data to be fetched. Once the data is available, the callback
will be called.

**Parameters:**
- `keys` (`WatchableKey | ReadonlyArray<WatchableKey>`)
- `callback` (`FlowAnyFunction`)
- `context?` (`FlowAnyObject | null`)

**Returns:** `Array<WatchableKey>`
