Options
All
  • Public
  • Public/Protected
  • All
Menu

Utilities for working with data from GQL Query responses.

Index

Functions

  • getEventCreatorName(creator?: null | User): string
  • getPrimaryQuote(company: Maybe<{ instruments: (Pick<Instrument, "isPrimary"> & { quotes: (Pick<Quote, "isPrimary"> & { exchange: { country: { countryCode: string } } })[] })[] }>): Maybe<DeepPartial<Quote>>
  • For the primary quote, US-based takes precedence, then isPrimary field on both instrument and quote, and finally the first instrument/quote we find if nothing else.

    To do this, sort all the primary instruments to the front, then sort the primary quotes for each. This gives us a primary sorted array of quotes.

    1. Use the first US-based quote if we have one
    2. Otherwise, use the first primary quote if we have one
    3. Lastly, just use the first quote we have

    Parameters

    • company: Maybe<{ instruments: (Pick<Instrument, "isPrimary"> & { quotes: (Pick<Quote, "isPrimary"> & { exchange: { country: { countryCode: string } } })[] })[] }>

    Returns Maybe<DeepPartial<Quote>>

  • useCompanyResolver(): ((identifiers: InstrumentID[]) => Promise<CompanyResolutionQuery["companies"] | undefined>)
  • usePrimaryWatchlistResolver(): ((identifiers: InstrumentID[], username: string) => Promise<string | undefined>)
  • Returns a function that can be used to upsert a primary watchlist using the provided username and identifiers

    Returns ((identifiers: InstrumentID[], username: string) => Promise<string | undefined>)

      • (identifiers: InstrumentID[], username: string): Promise<string | undefined>
      • Returns a function that can be used to upsert a primary watchlist using the provided username and identifiers

        Parameters

        • identifiers: InstrumentID[]

          list of FDC3-supported InstrumentIDs

        • username: string

          username to use for upserting a user

        Returns Promise<string | undefined>

  • useTrack(): ((event: TrackingEvent, object: TrackingObject, properties: {}) => Promise<void>)
  • Returns a function that can be used to track specific events with the app.

    The returned track function takes teh following params:

    Returns ((event: TrackingEvent, object: TrackingObject, properties: {}) => Promise<void>)

      • (event: TrackingEvent, object: TrackingObject, properties: {}): Promise<void>
      • Returns a function that can be used to track specific events with the app.

        The returned track function takes teh following params:

        Parameters

        • event: TrackingEvent

          The event type, we have normalized these to Click, View, Scroll and Submit

        • object: TrackingObject

          The thing the event is taking place on, ie. an Event like an earnings event

        • properties: {}

          A map/dictionary of additional information abotu the event, such as the component name, the object id, etc.

          • [key: string]: unknown

        Returns Promise<void>

  • useAutoTrack(event: TrackingEvent, object: TrackingObject, properties: {}, deps?: readonly unknown[], skip?: boolean): void
  • Automatically tracks an event when the deps change.

    Parameters

    • event: TrackingEvent

      The event type, we have normalized these to Click, View, Scroll and Submit

    • object: TrackingObject

      The thing the event is taking place on, ie. an Event like an earnings event

    • properties: {}

      A map/dictionary of additional information abotu the event, such as the component name, the object id, etc.

      • [key: string]: unknown
    • deps: readonly unknown[] = []
    • skip: boolean = false

      Dont track if this is true

    Returns void

  • useAlertList(poll?: boolean, interval?: number): { alertList: AlertList; addAlert: any; removeAlert: any; removeDateKey: any; loadAlertList: any }
  • Parameters

    • poll: boolean = false
    • interval: number = 3000

    Returns { alertList: AlertList; addAlert: any; removeAlert: any; removeDateKey: any; loadAlertList: any }

    • alertList: AlertList
    • addAlert:function
      • addAlert(date: string, id: string, metaData?: AlertEventMetaData): void
    • removeAlert:function
      • removeAlert(date: string, id: string): void
    • removeDateKey:function
      • removeDateKey(date: string): void
    • loadAlertList:function
      • loadAlertList(): Promise<void>
  • usePlaySound(url?: string): { playSound: any }

Variables

defaultSettings: { darkMode: boolean; textSentiment: boolean; tonalSentiment: boolean; syncWatchlist: boolean } = ...

Type declaration

  • darkMode: boolean
  • textSentiment: boolean
  • tonalSentiment: boolean
  • syncWatchlist: boolean
defaultAlertList: { dates: {}; events: {} } = ...

Type declaration

  • dates: {}
    • events: {}

      Generated using TypeDoc