Skip to main content

Overview

useFetchEntity returns a function that fetches a single entity by its Sublay entity ID. Use this for on-demand fetches outside of EntityProvider.

Usage Example

Parameters

entityId
string
required
The Sublay entity ID to fetch.
include
string | string[]
Optional. Populate related fields. Accepted values: "user", "space", "topComment", "saved", "files".

Returns

Entity
Entity
The fetched entity. When spaceReputation is requested, the embedded author carries an added spaceReputation number. See Entity data model and Reputation.