Skip to content

Commit

Permalink
Adds return types to a couple tsx files.
Browse files Browse the repository at this point in the history
  • Loading branch information
gmechali committed Dec 16, 2024
1 parent cf52904 commit 255638f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions static/js/apps/visualization/vis_type_configs/map_config.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ function getFacetSelector(appContext: AppContextType): JSX.Element {
const onSvFacetIdUpdated = (
svFacetId: Record<string, string>,
metadataMap: Record<string, StatMetadata>
) => {
): void => {
if (
svFacetId[statVar.dcid] === statVar.facetId ||
_.isEmpty(appContext.statVars)
Expand Down Expand Up @@ -87,7 +87,7 @@ export function getChartArea(
? [
{
isChecked: appContext.statVars[0].isPerCapita,
onUpdated: (isChecked: boolean) => {
onUpdated: (isChecked: boolean): void => {
const newStatVars = _.cloneDeep(appContext.statVars);
newStatVars[0].isPerCapita = isChecked;
appContext.setStatVars(newStatVars);
Expand Down Expand Up @@ -132,7 +132,7 @@ export function getChartArea(
lowestTitle: "Bottom Places",
}}
hideFooter={true}
onHoverToggled={(placeDcid, hover) => {
onHoverToggled={(placeDcid, hover): void => {
highlightPlaceToggle(
document.getElementById("vis-tool-map"),
placeDcid,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ function getSvChips(
color={
appContext.places.length == 1 ? COLORS[idx % COLORS.length] : ""
}
removeChip={() => {
removeChip={(): void => {
appContext.setStatVars(
appContext.statVars.filter(
(statVar) => statVar.dcid !== sv.dcid
Expand Down Expand Up @@ -116,7 +116,7 @@ function getFacetSelector(
const chartSvs = new Set(chartSvInfo.map((sv) => sv.dcid));
const onSvFacetIdUpdated = (svFacetId: Record<string, string>) => {
const facetsChanged = chartSvInfo.filter(
(sv) => sv.facetId !== svFacetId[sv.dcid]
(sv): boolean => sv.facetId !== svFacetId[sv.dcid]
);
if (_.isEmpty(facetsChanged)) {
return;
Expand Down Expand Up @@ -163,7 +163,7 @@ function getChartArea(
: [
{
isChecked: chartSvInfo[0].isPerCapita,
onUpdated: (isChecked: boolean) => {
onUpdated: (isChecked: boolean): void => {
const newStatVars = _.cloneDeep(appContext.statVars);
appContext.statVars.forEach((sv, idx) => {
if (chartSvs.has(sv.dcid)) {
Expand Down
2 changes: 1 addition & 1 deletion static/js/apps/visualization/vis_type_selector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export function VisTypeSelector(): JSX.Element {
return (
<div
className={`vis-type-option${visType === type ? " selected" : ""}`}
onClick={() => setVisType(type)}
onClick={(): void => setVisType(type)}
key={type}
>
<span className="label">{visTypeConfig.displayName}</span>
Expand Down

0 comments on commit 255638f

Please sign in to comment.