Skip to main content

Overview

useCollectionsActions exposes every collection action as a standalone callable function. It is used internally by useCollections but can also be used directly when you need fine-grained control over collection operations without the navigation state.
For most use cases, prefer useCollections — it combines these actions with navigation state. Use useCollectionsActions only when you need to perform actions independently of a navigation context.

Usage Example

Returns

(collection: Collection) => void
Push a collection onto the Redux navigation stack.
() => void
Pop the current collection from the navigation stack.
() => void
Reset navigation to the root collection.

Data Fetching

({ projectId }: { projectId: string }) => Promise<void>
Fetch and set the user’s root collection in Redux state.
({ projectId, collectionId }: { projectId: string; collectionId: string }) => Promise<void>
Fetch sub-collections for a given collection and update Redux state.

CRUD Operations

({ projectId, parentCollectionId, collectionName }: ...) => Promise<void>
Create a new sub-collection under the specified parent collection. Navigates into the new collection after creation.
({ projectId, collectionId, update }: ...) => Promise<void>
Update a collection’s name.
({ projectId, collection }: ...) => Promise<void>
Delete a collection. Updates Redux state to navigate back to the parent.
({ projectId, collectionId, entityId }: ...) => Promise<void>
Add an entity to a collection by creating a junction table entry.
({ projectId, collectionId, entityId }: ...) => Promise<void>
Remove an entity from a collection.

Utility

() => void
Clear all collections state from Redux (e.g., on sign-out).