Skip to content

Commit

Permalink
Use terser optional syntax.
Browse files Browse the repository at this point in the history
  • Loading branch information
cjcenizal committed Apr 10, 2020
1 parent dee5f09 commit da37aef
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,11 @@ import {

import { defaultColdPhase, defaultWarmPhase, defaultHotPhase } from '../store/defaults';

export let trackUiMetric: (metricType: UiStatsMetricType, eventName: string) => void;
export let trackUiMetric = (metricType: UiStatsMetricType, eventName: string) => {};

export function init(usageCollection: UsageCollectionSetup | undefined): void {
export function init(usageCollection?: UsageCollectionSetup): void {
if (usageCollection) {
trackUiMetric = usageCollection.reportUiStats.bind(usageCollection, UIM_APP_NAME);
} else {
trackUiMetric = (metricType, eventName) => {};
}
}

Expand Down

0 comments on commit da37aef

Please sign in to comment.