Skip to content

Commit a026093

Browse files
committed
update react-reducer-utils to 8.0.0
1 parent 2642679 commit a026093

File tree

6 files changed

+11
-23
lines changed

6 files changed

+11
-23
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@
8787
"react-dropzone": "^14.2.3",
8888
"react-error-boundary": "^4.0.13",
8989
"react-force-graph-2d": "^1.25.5",
90-
"react-reducer-utils": "^7.1.0",
90+
"react-reducer-utils": "^8.0.0",
9191
"react-redux": "^9.1.2",
9292
"react-resizable-panels": "^2.1.4",
9393
"react-responsive": "^10.0.0",

pnpm-lock.yaml

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/components/Pacs/PacsApp.tsx

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,8 @@ import { useEffect, useState } from "react";
1010
import {
1111
genUUID,
1212
getState,
13-
type ModuleToFunc,
14-
StateType,
15-
useReducer,
13+
type ThunkModuleToFunc,
14+
useThunk,
1615
} from "react-reducer-utils";
1716
import { useLocation, useSearchParams } from "react-router-dom";
1817
import { sanitizeAPIRootURL } from "../../api/api.ts";
@@ -26,7 +25,7 @@ import styles from "./PacsApp.module.css";
2625
import PacsView from "./PacsView.tsx";
2726
import type { PacsState } from "./types.ts";
2827

29-
type TDoPacs = ModuleToFunc<typeof DoPacs>;
28+
type TDoPacs = ThunkModuleToFunc<typeof DoPacs>;
3029

3130
/**
3231
* ChRIS_ui "PACS Query and Retrieve" controller + view.
@@ -76,10 +75,7 @@ export default () => {
7675
// ========================================
7776
// CLIENTS AND MISC
7877
// ========================================
79-
const [statePacs, doPacs] = useReducer<DoPacs.State, TDoPacs>(
80-
DoPacs,
81-
StateType.LOCAL,
82-
);
78+
const [statePacs, doPacs] = useThunk<DoPacs.State, TDoPacs>(DoPacs);
8379
const [searchParams, setSearchParams] = useSearchParams();
8480
const location = useLocation();
8581
const [pacsID, _] = useState(genUUID());

src/components/Pacs/index.tsx

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
1-
import type { ModuleToFunc } from "react-reducer-utils";
2-
import { useReducer } from "react-reducer-utils";
3-
import type * as DoPacs from "../../reducers/pacs";
41
import { InfoSection } from "../Common";
52
import Wrapper from "../Wrapper";
63
import PacsApp from "./PacsApp.tsx";
74

8-
type TDoPacs = ModuleToFunc<typeof DoPacs>;
9-
105
const PacsTitle = () => (
116
<InfoSection
127
title="Query and Retrieve PACS"

src/reducers/pacs.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import type { ReadonlyNonEmptyArray } from "fp-ts/lib/ReadonlyNonEmptyArray";
33
import {
44
init as _init,
55
type ClassState,
6-
createReducer,
76
type Dispatch,
87
getState,
98
type State as rState,
@@ -1181,5 +1180,3 @@ const checkIsToPullRequestSeries = (
11811180
const isPullStateNeedToPullRequest = (pullState: SeriesPullState) => {
11821181
return pullState === SeriesPullState.READY;
11831182
};
1184-
1185-
export default createReducer<State>();

testing/miniChRIS

0 commit comments

Comments
 (0)