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