Hey is a decentralized and permissionless social media app built with Lens Protocol 馃尶
at main 22 lines 743 B view raw
1import type { PostFragment } from "@hey/indexer"; 2import { createTrackedStore } from "@/store/createTrackedStore"; 3 4interface State { 5 postContent: string; 6 quotedPost?: PostFragment; 7 editingPost?: PostFragment; 8 setPostContent: (postContent: string) => void; 9 setQuotedPost: (quotedPost?: PostFragment) => void; 10 setEditingPost: (editingPost?: PostFragment) => void; 11} 12 13const { useStore: usePostStore } = createTrackedStore<State>((set) => ({ 14 editingPost: undefined, 15 postContent: "", 16 quotedPost: undefined, 17 setEditingPost: (editingPost) => set(() => ({ editingPost })), 18 setPostContent: (postContent) => set(() => ({ postContent })), 19 setQuotedPost: (quotedPost) => set(() => ({ quotedPost })) 20})); 21 22export { usePostStore };