Remove FlowFixMe's from TypeScript

Summary: This diff was a joy to draft.

Reviewed By: jknoxville

Differential Revision: D17344676

fbshipit-source-id: 0694d0393fa243edef61408ecfee92912fbbfa32
This commit is contained in:
Pascal Hartig
2019-09-12 10:18:25 -07:00
committed by Facebook Github Bot
parent f41cbcd429
commit cbbe32b9b9
11 changed files with 8 additions and 19 deletions

View File

@@ -157,17 +157,14 @@ export abstract class FlipperBasePlugin<
_teardown(): void {}
dispatchAction(actionData: Actions) {
// $FlowFixMe
const action = this.reducers[actionData.type];
if (!action) {
// $FlowFixMe
throw new ReferenceError(`Unknown action ${actionData.type}`);
}
if (typeof action === 'function') {
this.setState(action.call(this, this.state, actionData) as State);
} else {
// $FlowFixMe
throw new TypeError(`Reducer ${actionData.type} isn't a function`);
}
}