| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | 1x 2x 1x 2x 2x 1x | import { FilterMemberNames, Func, mixin } from '@fuselab/ui-shared/lib/typeHelpers';
import { Action, Dispatch } from 'redux';
function dispatchActions<T, S>(actionCreators: T, dispatch: Dispatch<S>, ...methods: FilterMemberNames<T, Func<Action>>[]): T {
return mixin(
actionCreators,
(x: Action) => {
dispatch(x);
return x;
},
...methods);
}
export default dispatchActions;
|