> Documentation index: https://www.gooddata.ai/docs/gooddata-ui/llms.txt lists every page of these docs as Markdown.

# SingleDashboardStoreAccessor

- Package: [@gooddata/sdk-ui-dashboard](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-dashboard/index.md)
- Kind: class
- Source: https://github.com/gooddata/gooddata-ui-sdk/blob/rel/11.64/libs/sdk-ui-dashboard/src/model/store/storeAccessors/SingleDashboardStoreAccessor.ts
- Guides: [useDashboardSelector](https://www.gooddata.ai/docs/gooddata-ui/latest/dashboard-plugins/use-dashboard-selector/index.md)

This singleton class uses [DashboardStoreAccessorRepository](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-dashboard/sdk-ui-dashboard.dashboardstoreaccessorrepository/index.md) to create a store accessor for a single dashboard.

**Signature:**

```typescript
export declare class SingleDashboardStoreAccessor 
```

## Remarks

The usage of this singleton is the same as for [DashboardStoreAccessorRepository](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-dashboard/sdk-ui-dashboard.dashboardstoreaccessorrepository/index.md) except functions don't accept any parameters.

example:

```tsx
import { SingleDashboardStoreAccessor } from "@gooddata/sdk-ui-dashboard";
 ...

const dispatch = SingleDashboardStoreAccessor.getDashboardDispatch();
if (dispatch) {
    dispatch({
        type: "GDC.DASH/CMD.SOME_COMMAND",
        payload: {},
    });
}
 ...
<Dashboard
    dashboard={dashboard}
    onStateChange={SingleDashboardStoreAccessor.getOnChangeHandler()}
/>
```

## Methods

| Method | Modifiers | Description |
| --- | --- | --- |
| [clearAccessor()](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-dashboard/sdk-ui-dashboard.singledashboardstoreaccessor/index.md#singledashboardstoreaccessorclearaccessor) | `static` | Removes dashboard accessors from for current dashboard. |
| [getDashboardDispatch()](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-dashboard/sdk-ui-dashboard.singledashboardstoreaccessor/index.md#singledashboardstoreaccessorgetdashboarddispatch) | `static` | Returns a dispatch object for current dashboard. |
| [getDashboardSelect()](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-dashboard/sdk-ui-dashboard.singledashboardstoreaccessor/index.md#singledashboardstoreaccessorgetdashboardselect) | `static` | Returns a selector for current dashboard. |
| [getOnChangeHandler()](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-dashboard/sdk-ui-dashboard.singledashboardstoreaccessor/index.md#singledashboardstoreaccessorgetonchangehandler) | `static` | Creates a callback for current dashboard. |
| [isAccessorInitialized()](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-dashboard/sdk-ui-dashboard.singledashboardstoreaccessor/index.md#singledashboardstoreaccessorisaccessorinitialized) | `static` | Checks if accessors is initialized for current dashboard. |

## Method details

### SingleDashboardStoreAccessor.clearAccessor()

Removes dashboard accessors from  for current dashboard.

**Signature:**

```typescript
static clearAccessor(): void;
```
**Returns:**

void

### SingleDashboardStoreAccessor.getDashboardDispatch()

Returns a dispatch object for current dashboard.

**Signature:**

```typescript
static getDashboardDispatch(): DashboardDispatch;
```
**Returns:**

[DashboardDispatch](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-dashboard/sdk-ui-dashboard.dashboarddispatch/index.md)

### SingleDashboardStoreAccessor.getDashboardSelect()

Returns a selector for current dashboard.

**Signature:**

```typescript
static getDashboardSelect(): DashboardSelectorEvaluator;
```
**Returns:**

[DashboardSelectorEvaluator](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-dashboard/sdk-ui-dashboard.dashboardselectorevaluator/index.md)

### SingleDashboardStoreAccessor.getOnChangeHandler()

Creates a  callback for current dashboard.

**Signature:**

```typescript
static getOnChangeHandler(): (state: DashboardState, dispatch: DashboardDispatch) => void;
```
**Returns:**

(state: [DashboardState](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-dashboard/sdk-ui-dashboard.dashboardstate/index.md), dispatch: [DashboardDispatch](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-dashboard/sdk-ui-dashboard.dashboarddispatch/index.md)) =&gt; void

### SingleDashboardStoreAccessor.isAccessorInitialized()

Checks if accessors is initialized for current dashboard.

**Signature:**

```typescript
static isAccessorInitialized(): boolean;
```
**Returns:**

boolean
