@modelhealth/modelhealth
    Preparing search index...

    Interface ActivityStream

    An async-iterable sequence of activities matching a filter.

    Returned by ActivitiesResource.list:

    for await (const activity of client.activities.list({ tags: ["study-a"] })) {
    console.log(activity.name);
    }

    Read ActivityStream.total for the number of activities matching the filter, or call ActivityStream.all to collect what is left into an array.

    interface ActivityStream {
        total: Promise<number>;
        "[asyncIterator]"(): AsyncIterator<Activity, any, any>;
        all(): Promise<Activity[]>;
        close(): void;
    }

    Hierarchy

    Index
    total: Promise<number>

    The full count of activities matching the filter.

    • Returns AsyncIterator<Activity, any, any>

    • Every remaining matching activity, continuing from where reading stopped.

      Returns Promise<Activity[]>

    • Releases what this sequence reads from. Idempotent.

      Reading to the end releases it for you. Stopping early deliberately does not, so all() still works afterwards — call this once you are done with such a sequence, or leave it to be collected.

      Returns void