1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
5 import { Dispatch } from 'redux';
6 import { store } from '../index';
8 export function dispatchAction<T extends (...args: any[]) => any>(callback: T, ...args: Parameters<T>): ReturnType<T> {
9 const dispatch = store.dispatch as Dispatch<any>;
10 return dispatch<any>(callback(...args));