Accounts Hooks
Accounts Hooks in Bitsocial React Hooks. Usage, options, and examples.
useAccount(): Account | undefined
useAccountComment({commentIndex?: number, commentCid?: string}): Comment // get one own comment by index or cid
useIsAccountComment({comment: Comment, accountName?: string}): boolean // whether the account published a loaded comment, including on pseudonymous boards and from another device, e.g. to show "(You)"
useAccountComments({filter?: AccountPublicationsFilter, commentCid?: string, commentIndices?: number[], communityAddress?: string, parentCid?: string, newerThan?: number, page?: number, pageSize?: number, sortType?: "new" | "old"}): {accountComments: Comment[]} // export or display list of own comments
useAccountVotes({filter?: AccountPublicationsFilter, vote?: number, commentCid?: string, communityAddress?: string, newerThan?: number, page?: number, pageSize?: number, sortType?: "new" | "old"}): {accountVotes: Vote[]} // export or display list of own votes
useAccountVote({commentCid: string}): Vote // know if you already voted on some comment
useAccountEdits({filer: AccountPublicationsFilter}): {accountEdits: AccountEdit[]}
useAccountCommunities(): {accountCommunities: {[communityAddress: string]: AccountCommunity}, onlyIfCached?: boolean}
useAccounts(): Account[]
useNotifications(): {notifications: Notification[], markAsRead: (notification?: Notification | string) => Promise<void>, markAsUnread: (notification: Notification | string) => Promise<void>, deleteNotification: (notification: Notification | string) => Promise<void>, deleteAllNotifications: () => Promise<void>}