userId (the only userId arguments are targets, on the host/invite hooks).
All hooks are importable from @sublay/react-js, @sublay/react-native, and @sublay/expo.
Unlike entities, events have no Redux store. State is local: load a single
event with
EventProvider / useEvent, and
paginate lists with useFetchManyEventsWrapper.events bundle on the project. Space-scoping needs spaces, images need files-images, and notifications need notifications.
Hooks at a glance
| Hook | Purpose |
|---|---|
useCreateEvent | Create an event (with optional inline cover/gallery). |
useFetchEvent | Fetch a single event by ID. |
useFetchManyEvents | One-shot list query (low-level). |
useFetchManyEventsWrapper | Stateful, paginated list with sort + load-more. |
useUpdateEvent | Edit an event; replace cover, append/remove gallery images. |
useDeleteEvent | Delete an event. |
useCancelEvent | Cancel an event. |
useSetRsvp | Set/change an RSVP. |
useWithdrawRsvp | Withdraw an RSVP. |
useAddHost / useRemoveHost | Manage hosts. |
useAddInvite / useRemoveInvite | Manage invites. |
useFetchInvitees | Host-only invitee list. |
useFetchEventRsvps | Named guest list. |
EventProvider / useEvent | Load one event into context with bound actions. |
Creating an event
useCreateEvent returns a callable. Cover and gallery uploads are inline — pass a cover and/or gallery and the hook sends multipart/form-data automatically. The logged-in user is auto-added as a host.
type: online needs url; physical needs address or location; hybrid needs both. See useCreateEvent for the full parameter list.
Listing events
UseuseFetchManyEventsWrapper for a ready-made paginated list with sort state and loadMore. Visibility is enforced server-side, so the list only contains events the current user may see.
RSVPing
rsvpCounts and the caller’s userRsvp. RSVPs close at startTime, are rejected on cancelled events, reject maybe when allowMaybe is false, and reject going at capacity.

