github.com/cockroachdb/cockroach@v20.2.0-alpha.1+incompatible/pkg/ui/src/util/analytics/trackTimeFrameChange.ts (about)

     1  // Copyright 2020 The Cockroach Authors.
     2  //
     3  // Use of this software is governed by the Business Source License
     4  // included in the file licenses/BSL.txt.
     5  //
     6  // As of the Change Date specified in that file, in accordance with
     7  // the Business Source License, use of this software will be governed
     8  // by the Apache License, Version 2.0, included in the file
     9  // licenses/APL.txt.
    10  import { analytics } from "src/redux/analytics";
    11  
    12  export const track = (fn: Function) => (direction: string) => {
    13    fn({
    14      event: "Time Frame Change",
    15      properties: {
    16        direction,
    17      },
    18    });
    19  };
    20  
    21  export default function trackTimeFrameChange(direction: string) {
    22    const boundTrack = analytics.track.bind(analytics);
    23    track(boundTrack)(direction);
    24  }