Skip to content

Commit fcb8ef5

Browse files
committed
added couple more notes to SIdebarContainer.tsx
Co-authored-by: Elena Atencio [email protected] Co-authored-by: Iris Wong [email protected] Co-authored-by: John Donato [email protected]
1 parent c212410 commit fcb8ef5

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

app/containers/SidebarContainer.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,17 @@ import { ApplicationContext } from '../context/ApplicationContext';
1111
import { AwsContext } from '../context/AwsContext';
1212

1313
const SidebarContainer = React.memo(props => {
14-
14+
// Extract invervalID from ApplicationContext. Initival value: intervalID = null
1515
const { intervalID } = useContext (ApplicationContext);
16-
const { isLoading, setLoadingState } = useContext(AwsContext);
16+
// Extract isLoading and setLoading state from AwsContext. Initial value: isLoading = true
17+
const { isLoading, setLoadingState } = useContext(AwsContext);
1718

1819
// clear interval and set loading state to true when leaving graph containers
20+
21+
/**
22+
* @function handleCLick - check if the 'intervalID' exists. If so, theres a timer running and the fuunction clears the timer using @function clearInterval - function.
23+
* Checks if variable 'isLoading' is false and if so the content is not loading and therefore, sets it to true using the setLoadingState function.
24+
*/
1925
const handleClick = () => {
2026
if(intervalID) clearInterval(intervalID);
2127
if(!isLoading) setLoadingState(true);

0 commit comments

Comments
 (0)