Passed
Pull Request — master (#44)
by Alejandro
03:53
created

utils.js ➔ ... ➔ ???   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 1
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 1
ccs 0
cts 1
cp 0
crap 2
rs 10
1 2
const DEFAULT_TIMEOUT_DELAY = 2000;
2
3 2
export const stateFlagTimeout = (setState, flagName, initialValue = true, delay = DEFAULT_TIMEOUT_DELAY) => {
4
  setState({ [flagName]: initialValue });
5
  setTimeout(() => setState({ [flagName]: !initialValue }), delay);
6
};
7