Commit c758c393 authored by Alejandro Celaya's avatar Alejandro Celaya Committed by Robert Knight

Fix typecheck errors from new redux major versions

parent fac2c3c8
/* global process */
import * as redux from 'redux';
import thunk from 'redux-thunk';
import { thunk } from 'redux-thunk';
import { immutable } from '../util/immutable';
import type { OmitFirstArg, TupleToIntersection } from './type-utils';
......
......@@ -2,7 +2,7 @@
* The drafts store provides temporary storage for unsaved edits to new or
* existing annotations.
*/
import type { Dispatch } from 'redux';
import type { ThunkDispatch } from 'redux-thunk';
import { createSelector } from 'reselect';
import type { Annotation } from '../../../types/api';
......@@ -105,7 +105,10 @@ function createDraft(annotation: AnnotationID, changes: DraftChanges) {
* An empty draft has no text and no reference tags.
*/
function deleteNewAndEmptyDrafts() {
return (dispatch: Dispatch, getState: () => { drafts: State }) => {
return (
dispatch: ThunkDispatch<{ drafts: State }, void, any>,
getState: () => { drafts: State },
) => {
const newDrafts = getState().drafts.drafts.filter(draft => {
return (
!draft.annotation.id &&
......
import {
createSelector,
createSelectorCreator,
defaultMemoize,
} from 'reselect';
import { createSelector, createSelectorCreator, lruMemoize } from 'reselect';
import shallowEqual from 'shallowequal';
import type {
......@@ -197,7 +193,7 @@ function searchUrisForFrame(frame: Frame): string[] {
// "selector creator" that uses `shallowEqual` instead of `===` for memoization
const createShallowEqualSelector = createSelectorCreator(
defaultMemoize,
lruMemoize,
shallowEqual,
);
......
......@@ -21,7 +21,7 @@
// Prevent automatic inclusion of global variables defined in `@types/<name>` packages.
// This prevents eg. Node globals from `@types/node` being included when writing
// code for the browser.
"types": ["redux-thunk/extend-redux"]
"types": []
},
"include": ["**/*.js", "**/*.ts", "**/*.tsx", "types/*.d.ts"],
"exclude": [
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment