Skip to content
This repository has been archived by the owner on Jan 9, 2023. It is now read-only.

Commit

Permalink
feat: use of Array.fill in monthlyIncidents useState
Browse files Browse the repository at this point in the history
  • Loading branch information
yosephAHMED committed Aug 20, 2020
1 parent 56ae1b8 commit bb4b9fb
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions src/incidents/visualize/VisualizeIncidents.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,7 @@ const VisualizeIncidents = () => {
const { data, isLoading } = useIncidents(searchRequest)
const [incident, setIncident] = useState(0)
const [showGraph, setShowGraph] = useState(false)
const [monthlyIncidents, setMonthlyIncidents] = useState([
// monthlyIncidents[0] -> January ... monthlyIncidents[11] -> December
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
])
const [monthlyIncidents, setMonthlyIncidents] = useState(Array(12).fill(0))

const getIncidentMonth = (reportedOn: string) =>
// reportedOn: "2020-08-12T19:53:30.153Z"
Expand Down

0 comments on commit bb4b9fb

Please sign in to comment.