Improve Redux types part 1 (#25872)
* Always dispatch thunk actions instead of calling them * Properly dispatch actions in SwitchChannelProvider * Fix tests relying on bad types * Properly pass actions into ManageTokens * Make other logic changes to support new types * Do the big type migrations without any logic changes * Revert "Properly dispatch actions in SwitchChannelProvider" This reverts commit 28c8c7af2ef324c6814087a81baca66c60477daa. * Revert "Revert "Properly dispatch actions in SwitchChannelProvider"" This reverts commit 47115c5217ae90547040e7b7de32979a33f0845b.
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
0a4e9eeb92
Коммит
978f335925
@@ -3,9 +3,7 @@
|
||||
|
||||
import {connect} from 'react-redux';
|
||||
import {bindActionCreators} from 'redux';
|
||||
import type {ActionCreatorsMapObject, Dispatch} from 'redux';
|
||||
|
||||
import type {Action, GenericAction} from 'mattermost-redux/types/actions.js';
|
||||
import type {Dispatch} from 'redux';
|
||||
|
||||
import {closeModal} from 'actions/views/modals';
|
||||
|
||||
@@ -19,13 +17,9 @@ function mapStateToProps(state: GlobalState) {
|
||||
};
|
||||
}
|
||||
|
||||
type Actions = {
|
||||
closeModal: (modalId: string) => void;
|
||||
}
|
||||
|
||||
function mapDispatchToProps(dispatch: Dispatch<GenericAction>) {
|
||||
function mapDispatchToProps(dispatch: Dispatch) {
|
||||
return {
|
||||
actions: bindActionCreators<ActionCreatorsMapObject<Action>, Actions>({
|
||||
actions: bindActionCreators({
|
||||
closeModal,
|
||||
}, dispatch),
|
||||
};
|
||||
|
||||
Ссылка в новой задаче
Block a user