List all comment and community edits the account has performed
List all comment and community edits the account has performed in Bitsocial React Hooks. Usage, options, and examples.
const { accountEdits } = useAccountEdits();
for (const accountEdit of accountEdits) {
console.log(accountEdit);
}
console.log(`there's ${accountEdits.length} account edits`);
// get only the account edits of a specific comment
const commentCid = "Qm...";
const filter = useCallback((edit) => edit.commentCid === commentCid, [commentCid]); // important to use useMemo or the same function or will cause rerenders
const { accountEdits } = useAccountEdits({ filter });
// only get account edits in a specific community
const communityAddress = "news.eth";
const filter = useCallback(
(edit) => edit.communityAddress === communityAddress,
[communityAddress],
);
const { accountEdits } = useAccountEdits({ filter });