-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(redux): bump redux to v5 and react-redux to v9
bump redux to v5 and react-redux to v9 BREAKING CHANGE: bump redux to v5 and react-redux to v9
- Loading branch information
Showing
20 changed files
with
257 additions
and
885 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
src/state/middleware/drop/drop-animation-finish-middleware.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,42 @@ | ||
import type { DropResult } from '../../types'; | ||
import type { Action, Dispatch } from '../store-types'; | ||
import type { Middleware } from '../store-types'; | ||
import { guard } from '../action-creators'; | ||
import type { FocusMarshal } from '../../view/use-focus-marshal/focus-marshal-types'; | ||
|
||
export default (marshal: FocusMarshal) => { | ||
export default (marshal: FocusMarshal): Middleware => { | ||
let isWatching = false; | ||
|
||
return () => | ||
(next: Dispatch) => | ||
(action: Action): any => { | ||
if (action.type === 'INITIAL_PUBLISH') { | ||
isWatching = true; | ||
|
||
marshal.tryRecordFocus(action.payload.critical.draggable.id); | ||
next(action); | ||
marshal.tryRestoreFocusRecorded(); | ||
return; | ||
} | ||
return () => (next) => (action) => { | ||
if (guard(action, 'INITIAL_PUBLISH')) { | ||
isWatching = true; | ||
|
||
marshal.tryRecordFocus(action.payload.critical.draggable.id); | ||
next(action); | ||
marshal.tryRestoreFocusRecorded(); | ||
return; | ||
} | ||
|
||
if (!isWatching) { | ||
return; | ||
} | ||
next(action); | ||
|
||
if (action.type === 'FLUSH') { | ||
isWatching = false; | ||
marshal.tryRestoreFocusRecorded(); | ||
return; | ||
} | ||
if (!isWatching) { | ||
return; | ||
} | ||
|
||
if (guard(action, 'FLUSH')) { | ||
isWatching = false; | ||
marshal.tryRestoreFocusRecorded(); | ||
return; | ||
} | ||
|
||
if (guard(action, 'DROP_COMPLETE')) { | ||
isWatching = false; | ||
const result: DropResult = action.payload.completed.result; | ||
|
||
if (action.type === 'DROP_COMPLETE') { | ||
isWatching = false; | ||
const result: DropResult = action.payload.completed.result; | ||
|
||
// give focus to the combine target when combining | ||
if (result.combine) { | ||
marshal.tryShiftRecord( | ||
result.draggableId, | ||
result.combine.draggableId, | ||
); | ||
} | ||
marshal.tryRestoreFocusRecorded(); | ||
// give focus to the combine target when combining | ||
if (result.combine) { | ||
marshal.tryShiftRecord(result.draggableId, result.combine.draggableId); | ||
} | ||
}; | ||
marshal.tryRestoreFocusRecorded(); | ||
} | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.