@playlive/fundraiser-data
    Preparing search index...

    Function flattenDonationPages

    • Flatten a TanStack-shaped paginated donation envelope ({ pages: [{ data: TiltifyDonation[] }, …] }) to a single sorted array. Handy for column scroll-lists and donor-feed panels that only need the row-level view.

      • flipSorting: false (default) → newest first (completed_at desc).
      • flipSorting: true → oldest first (completed_at asc).

      null / undefined / missing-pages input returns []. Rows that don't structurally match a TiltifyDonation (missing id or amount) are dropped defensively.

      For a stateful projection that preserves donations dropped from later pages (e.g. under maxPages), see useDonationsReducer in @playlive/react-query.

      Parameters

      • donationsData: DonationPagesInput | null | undefined
      • options: { flipSorting?: boolean } = {}

      Returns TiltifyDonation[]