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:
committed by
Facebook Github Bot
parent
f41cbcd429
commit
cbbe32b9b9
@@ -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`);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user