src/component/tab/BaseRefreshableTab.jsx   A
last analyzed

Complexity

Total Complexity 2
Complexity/F 1

Size

Lines of Code 16
Function Count 2

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 11
dl 0
loc 16
rs 10
c 0
b 0
f 0
wmc 2
mnd 0
bc 0
fnc 2
bpm 0
cpm 1
noi 0

2 Functions

Rating   Name   Duplication   Size   Complexity  
A BaseRefreshableTab.refresh 0 4 1
A BaseRefreshableTab.setSubState 0 4 1
1
import React from 'react';
2
3
// TODO showLoading도 여기서 관리하도록 변경
4
export default class BaseRefreshableTab extends React.Component {
5
  // TODO util로 분류하기
6
  setSubState(key, state) {
7
    const newState = Object.assign({}, this.state[key], state);
8
    this.setState({ [key]: newState });
9
  }
10
11
  refresh() {
12
    // TODO refresh 코드도 공통화
13
    throw new Error('Should implement this method "refresh()"');
14
  }
15
}
16