aboutsummaryrefslogtreecommitdiff
path: root/src/console/reducers
diff options
context:
space:
mode:
authorShin'ya Ueoka <ueokande@i-beam.org>2019-12-22 11:10:36 +0900
committerGitHub <noreply@github.com>2019-12-22 11:10:36 +0900
commitb1a6f374dca078dee2406ebe049715b826e37ca2 (patch)
tree5367c48648e2018f55f12d847baba94559e10040 /src/console/reducers
parentb2dcdedad729ff7087867da50e20578f9fc8fb29 (diff)
parentda72c2ddd916d79d134662e3985b53a4ac78af7a (diff)
Merge pull request #690 from ueokande/eslint-and-prettier
Eslint and prettier
Diffstat (limited to 'src/console/reducers')
-rw-r--r--src/console/reducers/index.ts10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/console/reducers/index.ts b/src/console/reducers/index.ts
index b6be483..048a24f 100644
--- a/src/console/reducers/index.ts
+++ b/src/console/reducers/index.ts
@@ -28,7 +28,7 @@ const nextSelection = (state: State): number => {
return 0;
}
- let length = state.completions
+ const length = state.completions
.map(g => g.items.length)
.reduce((x, y) => x + y);
if (state.select + 1 < length) {
@@ -38,7 +38,7 @@ const nextSelection = (state: State): number => {
};
const prevSelection = (state: State): number => {
- let length = state.completions
+ const length = state.completions
.map(g => g.items.length)
.reduce((x, y) => x + y);
if (state.select < 0) {
@@ -51,7 +51,7 @@ const nextConsoleText = (completions: any[], select: number, defaults: any) => {
if (select < 0) {
return defaults;
}
- let items = completions.map(g => g.items).reduce((g1, g2) => g1.concat(g2));
+ const items = completions.map(g => g.items).reduce((g1, g2) => g1.concat(g2));
return items[select].content;
};
@@ -96,14 +96,14 @@ export default function reducer(
completionSource: action.completionSource,
select: -1 };
case actions.CONSOLE_COMPLETION_NEXT: {
- let select = nextSelection(state);
+ const select = nextSelection(state);
return { ...state,
select: select,
consoleText: nextConsoleText(
state.completions, select, state.completionSource) };
}
case actions.CONSOLE_COMPLETION_PREV: {
- let select = prevSelection(state);
+ const select = prevSelection(state);
return { ...state,
select: select,
consoleText: nextConsoleText(