feat(notes/nui): interface for useNotes

This commit is contained in:
Christopher committed 2021-01-14 20:18:59 +01:00
1 parent 92579dd213
commit 5960524b98
2 files changed
+8 -3

No files matched your search

+1 -1
View File
@@ -18,7 +18,7 @@ import useStyles from './notes.styles';
export const NotesApp = () => {
const { setNoteModal } = useNoteModal();
const { detail, setDetail } = useNoteDetail();
const notes = useNotes();
const { notes } = useNotes();
const notesApp = useApp('NOTES');
const classes = useStyles();
+7 -2
View File
@@ -1,7 +1,12 @@
import { useRecoilValue } from 'recoil';
import { Note } from '../../../common/typings/notes';
import { noteStates } from './state';
export const useNotes = () => {
interface NotesProps {
notes: Note[];
}
export const useNotes = (): NotesProps => {
const notes = useRecoilValue(noteStates.noteItems);
return notes;
return { notes };
}