diff --git a/src/reduxTypes.js b/src/reduxTypes.js index 53ce0a92558..ed12d496d2c 100644 --- a/src/reduxTypes.js +++ b/src/reduxTypes.js @@ -521,8 +521,7 @@ export interface Dispatch { } /** A per-account thunk action returning T. */ -// TODO(#5006): use PerAccountState -export type ThunkAction = (Dispatch, () => GlobalState, ThunkExtras) => T; +export type ThunkAction = (Dispatch, () => PerAccountState, ThunkExtras) => T; /** The Redux `dispatch` for a global context. */ export interface GlobalDispatch { @@ -547,6 +546,9 @@ export type GlobalThunkAction = ( // usable as a plain Dispatch, and a ThunkAction as a GlobalThunkAction. (d: GlobalDispatch): Dispatch => d; // TODO(#5006) (a: ThunkAction): GlobalThunkAction => a; // TODO(#5006) -// And for *right* now, we allow the reverse, too. -(d: Dispatch): GlobalDispatch => d; // TODO(#5006) -(a: GlobalThunkAction): ThunkAction => a; // TODO(#5006) +// But we don't allow the reverse. +// $FlowExpectedError[incompatible-return] +(d: Dispatch): GlobalDispatch => d; +// $FlowExpectedError[incompatible-exact] +// $FlowExpectedError[prop-missing] +(a: GlobalThunkAction): ThunkAction => a;