Overview
useFetchManyEventsWrapper wraps useFetchManyEvents into a ready-to-render list: it holds the accumulated events, tracks loading/hasMore, manages sort state, and exposes loadMore and refetch. It mirrors useFetchManyEntitiesWrapper. Visibility is enforced server-side, so the list only contains events the current user may see. The space’s active admins and moderators see every event in their space, invite events included; a host who isn’t an active member of the event’s space sees only what a regular viewer would. See Event visibility.
Changing any filter prop (or calling refetch) reloads the list from page 1.
Usage Example
Parameters
Page size: a whole number from
1 to 100. Defaults to 10. A larger value is rejected with 400 event/invalid-query, never lowered to 100.Only this space’s events, or
"none" for events not in any space. Left out or null: every event.Associations to expand, as a single value or an array:
"user", "space", "files", "userRsvp".Initial sort direction. Defaults to
null: no direction is sent, so the sort’s natural one applies (soonest first for "startTime", most going first for "going").Returns
The last load failure, or
null. Cleared when the next load starts; loadMore() retries it. A SublayError.Change the sort direction (resets to page 1). Pass
null to go back to the sort’s natural direction.Load the next page and append it, or retry the load that failed. Does nothing while a load is running or when there is nothing more. Never rejects: a failure lands in
error.Reload from page 1 with the current filters and sort. The loaded events stay until the new first page replaces them. Never rejects: a failure lands in
error.
