useFollow
function useFollow(group, id): object;Optimistic follow/unfollow with server hydration. Inside a disabled provider,
follow/unfollow no-op resolve undefined, nothing hydrates, enabled is false.
follow(targetGroup, targetId) / unfollow(targetGroup, targetId) reject after
rolling back — see the file header.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
group |
string |
id |
string |
Returns
Section titled “Returns”object
enabled
Section titled “enabled”enabled: boolean;follow
Section titled “follow”follow: (tGroup, tId, opts?) => Promise<void>;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
tGroup |
string |
tId |
string |
opts? |
{ onError?: OptimisticOnError; } |
opts.onError? |
OptimisticOnError |
Returns
Section titled “Returns”Promise<void>
isFollowing
Section titled “isFollowing”isFollowing: (tGroup, tId) => boolean;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
tGroup |
string |
tId |
string |
Returns
Section titled “Returns”boolean
unfollow
Section titled “unfollow”unfollow: (tGroup, tId, opts?) => Promise<void>;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
tGroup |
string |
tId |
string |
opts? |
{ onError?: OptimisticOnError; } |
opts.onError? |
OptimisticOnError |
Returns
Section titled “Returns”Promise<void>
Throws
Section titled “Throws”The network error after the optimistic edge toggle has been rolled back.