Skip to content

Commit

Permalink
Add useClearRecentPosts hook (#412)
Browse files Browse the repository at this point in the history
* Add useClearRecentPosts hook

* Fix

* Fix code review
  • Loading branch information
paulxuca authored Jul 14, 2023
1 parent efa29fa commit 847a9db
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/orange-gorillas-jump.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@lens-protocol/react": minor
---

**Added** `useClearRecentPosts` hook
1 change: 1 addition & 0 deletions packages/react/src/transactions/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export * from './useUpdateDispatcherConfig';
export * from './useUpdateFollowPolicy';
export * from './useUpdateProfileDetails';
export * from './useUpdateProfileImage';
export * from './useClearRecentPosts';

/**
* Domain
Expand Down
11 changes: 11 additions & 0 deletions packages/react/src/transactions/useClearRecentPosts.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { recentPosts } from './adapters/responders/CreatePostResponder';

/**
* @category Publications
* @group Hooks
*/
export function useClearRecentPosts() {
return () => {
recentPosts([]);
};
}

0 comments on commit 847a9db

Please sign in to comment.