Skip to content
This repository was archived by the owner on Jan 11, 2023. It is now read-only.

Commit 27b94fb

Browse files
Łukasz SobekjasonLaster
authored andcommitted
Removes toJS in some redux files (#5755)
1 parent a3abbf1 commit 27b94fb

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

src/actions/breakpoints/syncBreakpoint.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ export async function syncClientBreakpoint(
7070
): Promise<BreakpointSyncData> {
7171
assertPendingBreakpoint(pendingBreakpoint);
7272

73-
const source = getSource(getState(), sourceId).toJS();
73+
const source = getSource(getState(), sourceId);
7474
const generatedSourceId = sourceMaps.isOriginalId(sourceId)
7575
? originalToGeneratedId(sourceId)
7676
: sourceId;
@@ -86,7 +86,7 @@ export async function syncClientBreakpoint(
8686

8787
const scopedGeneratedLocation = await getGeneratedLocation(
8888
getState(),
89-
source,
89+
source.toJS(),
9090
scopedLocation,
9191
sourceMaps
9292
);

src/actions/expressions.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ export function deleteExpression(expression: Expression) {
9696
*/
9797
export function evaluateExpressions() {
9898
return async function({ dispatch, getState, client }: ThunkArgs) {
99-
const expressions = getExpressions(getState()).toJS();
99+
const expressions = getExpressions(getState());
100100
for (const expression of expressions) {
101101
await dispatch(evaluateExpression(expression));
102102
}

src/actions/pause/continueToHere.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ import type { ThunkArgs } from "../types";
1717

1818
export function continueToHere(line: number) {
1919
return async function({ dispatch, getState }: ThunkArgs) {
20-
const source = getSelectedSource(getState()).toJS();
20+
const selectedSource = getSelectedSource(getState());
2121

22-
if (!isPaused(getState())) {
22+
if (!isPaused(getState()) || !selectedSource) {
2323
return;
2424
}
2525

@@ -36,7 +36,7 @@ export function continueToHere(line: number) {
3636
addHiddenBreakpoint({
3737
line,
3838
column: undefined,
39-
sourceId: source.id
39+
sourceId: selectedSource.id
4040
})
4141
);
4242

src/actions/preview.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ export function updatePreview(target: HTMLElement, editor: any) {
122122
}
123123

124124
const source = getSelectedSource(getState());
125-
const symbols = getSymbols(getState(), source.toJS());
125+
const symbols = getSymbols(getState(), source);
126126

127127
let match;
128128
if (!symbols || symbols.loading) {

src/reducers/sources.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,11 +296,11 @@ export function getNewSelectedSourceId(
296296
return "";
297297
}
298298

299-
const tabUrls = state.sources.tabs.toJS();
299+
const tabUrls = state.sources.tabs;
300300
const leftNeighborIndex = Math.max(tabUrls.indexOf(selectedTabUrl) - 1, 0);
301301
const lastAvailbleTabIndex = availableTabs.size - 1;
302302
const newSelectedTabIndex = Math.min(leftNeighborIndex, lastAvailbleTabIndex);
303-
const availableTab = availableTabs.toJS()[newSelectedTabIndex];
303+
const availableTab = availableTabs.get(newSelectedTabIndex);
304304
const tabSource = getSourceByUrlInSources(
305305
state.sources.sources,
306306
availableTab

0 commit comments

Comments
 (0)