SingleDashboardStoreAccessor
This singleton class uses DashboardStoreAccessorRepository to create a store accessor for a single dashboard.
export declare class SingleDashboardStoreAccessor
Remarks
The usage of this singleton is the same as for DashboardStoreAccessorRepository except functions don’t accept any parameters.
example:
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 |
|---|---|---|
| Removes dashboard accessors from for current dashboard. | |
| Returns a dispatch object for current dashboard. | |
| Returns a selector for current dashboard. | |
| Creates a callback for current dashboard. | |
| Checks if accessors is initialized for current dashboard. |
Method details
SingleDashboardStoreAccessor.clearAccessor()method
Removes dashboard accessors from for current dashboard.
static clearAccessor(): void;
Returns
void
SingleDashboardStoreAccessor.getDashboardDispatch()method
Returns a dispatch object for current dashboard.
static getDashboardDispatch(): DashboardDispatch;
Returns
SingleDashboardStoreAccessor.getDashboardSelect()method
Returns a selector for current dashboard.
static getDashboardSelect(): DashboardSelectorEvaluator;
Returns
SingleDashboardStoreAccessor.getOnChangeHandler()method
Creates a callback for current dashboard.
static getOnChangeHandler(): (state: DashboardState, dispatch: DashboardDispatch) => void;
Returns
(state: DashboardState, dispatch: DashboardDispatch) => void
SingleDashboardStoreAccessor.isAccessorInitialized()method
Checks if accessors is initialized for current dashboard.
static isAccessorInitialized(): boolean;
Returns
boolean