ixfx
    Preparing search index...

    Class TrackedValueMap<V, T, TResult>

    Keeps track of keyed values of type V (eg Point). It stores occurences in type T, which must extend from TrackerBase<V>, eg PointTracker.

    The creator function passed in to the constructor is responsible for instantiating the appropriate TrackerBase sub-class.

    export class PointsTracker extends TrackedValueMap<Points.Point> {
    constructor(opts:TrackOpts = {}) {
    super((key, start) => {
    if (start === undefined) throw new Error(`Requires start point`);
    const p = new PointTracker(key, opts);
    p.seen(start);
    return p;
    });
    }
    }

    Type Parameters

    Hierarchy (View Summary)

    Index

    Accessors

    Constructors

    Methods

    • Creates or returns a TrackedValue instance for id.

      Parameters

      • id: string
      • ...values: V[]

      Returns Promise<T>

    • Enumerate last received values

      Returns Generator<undefined | V, void, unknown>

      const pointers = pointTracker();
      const c = Points.centroid(...Array.from(pointers.lastPoints()));
    • For a given id, note that we have seen one or more values.

      Parameters

      • id: string

        Id

      • ...values: V[]

        Values(s)

      Returns Promise<TResult>

      Information about start to last value

    • Iterates underlying values, ordered by age (oldest first) First the named values are sorted by their elapsed value, and then we return the last value for that group.

      Returns Generator<undefined | V, void, unknown>

    Properties

    gog: Maps.GetOrGenerate<string, T, V>
    store: Map<string, T>