hooks/useSCConnectionsManager
Functions
useSCConnectionsManager()
useSCConnectionsManager(
user?): {acceptConnection:undefined;cancelRequestConnection:undefined;connections:any[];emptyCache:undefined;isLoading: (v) =>boolean;loading:any[];refresh:undefined;removeConnection:undefined;requestConnection:undefined;status:undefined; } | {acceptConnection: (user) =>Promise<any>;cancelRequestConnection: (user) =>Promise<any>;connections:any[];emptyCache: () =>void;isLoading: (v) =>boolean;loading:any[];refresh: () =>void;removeConnection: (user) =>Promise<any>;requestConnection: (user) =>Promise<any>;status: (user) =>string; }
This custom hook is used to manage to manage friends.
Follow these steps:
1. const scUserContext: SCUserContextType = useSCUser();
2. const scConnectionsManager: SCConnectionsManagerType = scUserContext.manager.connections;
3. scConnectionsManager.status(user)
Parameters
| Parameter | Type |
|---|---|
user? | SCUserType |
Returns
{ acceptConnection: undefined; cancelRequestConnection: undefined; connections: any[]; emptyCache: undefined; isLoading: (v) => boolean; loading: any[]; refresh: undefined; removeConnection: undefined; requestConnection: undefined; status: undefined; }
| Name | Type | Default value |
|---|---|---|
acceptConnection? | undefined | - |
cancelRequestConnection? | undefined | - |
connections | any[] | data |
emptyCache? | undefined | - |
isLoading() | (v) => boolean | - |
loading | any[] | - |
refresh? | undefined | - |
removeConnection? | undefined | - |
requestConnection? | undefined | - |
status? | undefined | - |
{ acceptConnection: (user) => Promise<any>; cancelRequestConnection: (user) => Promise<any>; connections: any[]; emptyCache: () => void; isLoading: (v) => boolean; loading: any[]; refresh: () => void; removeConnection: (user) => Promise<any>; requestConnection: (user) => Promise<any>; status: (user) => string; }
| Name | Type | Default value |
|---|---|---|
acceptConnection() | (user) => Promise<any> | - |
cancelRequestConnection() | (user) => Promise<any> | - |
connections | any[] | data |
emptyCache() | () => void | - |
isLoading() | (v) => boolean | - |
loading | any[] | - |
refresh() | () => void | - |
removeConnection() | (user) => Promise<any> | - |
requestConnection() | (user) => Promise<any> | - |
status() | (user) => string | - |