mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 12:56:41 +07:00
refactored hooks directory
This commit is contained in:
parent
efa3ba902d
commit
f76a5a4798
106 changed files with 122 additions and 144 deletions
20
src/hooks/node/useFullNode.ts
Normal file
20
src/hooks/node/useFullNode.ts
Normal file
|
@ -0,0 +1,20 @@
|
|||
import { useShallowSelect } from '~/hooks/data/useShallowSelect';
|
||||
import { selectNode } from '~/redux/node/selectors';
|
||||
import { useLoadNode } from '~/hooks/node/useLoadNode';
|
||||
import { useOnNodeSeen } from '~/hooks/node/useOnNodeSeen';
|
||||
|
||||
export const useFullNode = (id: string) => {
|
||||
const {
|
||||
is_loading: isLoading,
|
||||
current: node,
|
||||
comments,
|
||||
comment_count: commentsCount,
|
||||
is_loading_comments: isLoadingComments,
|
||||
lastSeenCurrent,
|
||||
} = useShallowSelect(selectNode);
|
||||
|
||||
useLoadNode(id);
|
||||
// useOnNodeSeen(node);
|
||||
|
||||
return { node, comments, commentsCount, lastSeenCurrent, isLoading, isLoadingComments };
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue