Options
All
  • Public
  • Public/Protected
  • All
Menu

A GeoJoinerOnSnapshot subscribes and aggregates multiple onSnapshot listeners while filtering out documents not in query radius.

Hierarchy

  • GeoJoinerOnSnapshot

Index

Constructors

constructor

  • Parameters

    • _queries: Query[]

      An array of Firestore Queries to aggregate.

    • _queryCriteria: QueryCriteria

      The query criteria of geo based queries, includes field such as center, radius, and limit.

    • _onNext: function

      A callback to be called every time a new QuerySnapshot is available.

    • Optional _onError: function

      A callback to be called if the listen fails or is cancelled. No further callbacks will occur.

        • (error: Error): void
        • Parameters

          • error: Error

          Returns void

    Returns GeoJoinerOnSnapshot

Properties

Private _docs

_docs: Map<string, DocMap> = new Map()

Private _error

_error: Error

Private _firstEmitted

_firstEmitted: boolean = false

Private _firstRoundResolved

_firstRoundResolved: boolean = false

Private _interval

_interval: any

Private _newValues

_newValues: boolean = false

Private Optional _onError

_onError: function

A callback to be called if the listen fails or is cancelled. No further callbacks will occur.

Type declaration

    • (error: Error): void
    • Parameters

      • error: Error

      Returns void

Private _onNext

_onNext: function

A callback to be called every time a new QuerySnapshot is available.

Type declaration

Private _queries

_queries: Query[]

An array of Firestore Queries to aggregate.

Private _queriesResolved

_queriesResolved: number[] = []

Private _queryCriteria

_queryCriteria: QueryCriteria

The query criteria of geo based queries, includes field such as center, radius, and limit.

Private _subscriptions

_subscriptions: Array<function> = []

Methods

Private _emit

  • _emit(): void
  • Determines if new values should be emitted via next or if subscription should be killed with error.

    Returns void

Private _next

  • _next(): void
  • Runs through documents stored in map to set value to send in next function.

    Returns void

Private _processSnapshot

  • Parses snapshot and filters out documents not in query radius. Sets new values to _docs map.

    Parameters

    • snapshot: QuerySnapshot

      The QuerySnapshot of the query.

    • index: number

      Index of query who's snapshot has been triggered.

    Returns void

unsubscribe

  • unsubscribe(): function
  • A functions that clears the interval and ends all query subscriptions.

    Returns function

    An unsubscribe function that can be called to cancel all snapshot listener.

      • (): void
      • Returns void

Generated using TypeDoc