Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
coopwire-hypothesis
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
孙灵跃 Leon Sun
coopwire-hypothesis
Commits
c758c393
Commit
c758c393
authored
Dec 06, 2023
by
Alejandro Celaya
Committed by
Robert Knight
Dec 12, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix typecheck errors from new redux major versions
parent
fac2c3c8
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
10 deletions
+9
-10
create-store.ts
src/sidebar/store/create-store.ts
+1
-1
drafts.ts
src/sidebar/store/modules/drafts.ts
+5
-2
frames.ts
src/sidebar/store/modules/frames.ts
+2
-6
tsconfig.json
src/tsconfig.json
+1
-1
No files found.
src/sidebar/store/create-store.ts
View file @
c758c393
/* 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'
;
...
...
src/sidebar/store/modules/drafts.ts
View file @
c758c393
...
...
@@ -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
&&
...
...
src/sidebar/store/modules/frames.ts
View file @
c758c393
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
(
default
Memoize
,
lru
Memoize
,
shallowEqual
,
);
...
...
src/tsconfig.json
View file @
c758c393
...
...
@@ -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"
:
[
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment