Skip to content

Commit f9d691a

Browse files
committed
getChildrenをシンプル化
1 parent 902e521 commit f9d691a

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/explorers/qiitaItems.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,17 +71,15 @@ class QiitaItemsProvider implements TreeDataProvider<NodeTypes> {
7171
await this.refreshItems();
7272
}
7373

74-
const children = [];
75-
76-
for (const item of this.items) {
74+
const children: NodeTypes[] = this.items.map((item) => {
7775
const command = {
7876
command: 'qiita.openItem',
7977
title: localize('commands.openItem.title', '開く'),
8078
arguments: [ item ],
8179
};
8280

83-
children.push(new QiitaItem(item, TreeItemCollapsibleState.None, command));
84-
}
81+
return new QiitaItem(item, TreeItemCollapsibleState.None, command);
82+
});
8583

8684
// アイテムが最後まで読み込まれていない場合、「さらに読み込む...」を挿入する
8785
if (!this.done) {

0 commit comments

Comments
 (0)