@lens-protocol/react
Version:
Interacting with the Lens Protocol API using React.
38 lines (37 loc) • 1.15 kB
TypeScript
import { ProfileInterestTypes } from '@lens-protocol/api-bindings';
import { UseDeferredTask } from "../helpers/tasks.js";
export { ProfileInterestTypes };
export type RemoveProfileInterestsArgs = {
interests: ProfileInterestTypes[];
};
/**
* Remove profile interests.
*
* You MUST be authenticated via {@link useLogin} to use this hook.
*
* @example
* ```tsx
* function ProfileInterests({ profile }: { profile: Profile }) {
* const { execute: addInterests } = useAddProfileInterests();
* const { execute: removeInterests } = useRemoveProfileInterests();
*
* const handleClick = async (interest: ProfileInterestTypes) => {
* const request = {
* interests: [interest],
* };
*
* if (profile.interests.includes(interest)) {
* await removeInterests(request);
* } else {
* await addInterests(request);
* }
* };
*
* return <button onClick={() => handleClick(ProfileInterestTypes.Business)}>Business</button>;
* }
* ```
*
* @category Profiles
* @group Hooks
*/
export declare function useRemoveProfileInterests(): UseDeferredTask<void, never, RemoveProfileInterestsArgs>;