From 863f908f053951357938c9e6938c5d36af39489c Mon Sep 17 00:00:00 2001 From: chip Date: Sun, 23 Aug 2020 01:27:59 +0200 Subject: [PATCH] Feat(PhoneApp): PhoneApp hook --- src/apps/phone/hooks/useCalls.js | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 src/apps/phone/hooks/useCalls.js diff --git a/src/apps/phone/hooks/useCalls.js b/src/apps/phone/hooks/useCalls.js new file mode 100644 index 0000000..8cec4dc --- /dev/null +++ b/src/apps/phone/hooks/useCalls.js @@ -0,0 +1,25 @@ +import { useRecoilState, atom } from 'recoil'; + +const callListState = atom({ + key: 'callList', + default: [ + { + id: 0, + caller: 'Kidz', + phoneNumber: "000-1111", + type: 'incoming' + }, + { + id: 1, + caller: 'ROCKY', + phoneNumber: '000-1112', + type: 'outgoing' + }, + ], +}); + +export const useCalls = () => { + const [callList, setCallList] = useRecoilState + (callListState); + return { callList, setCallList }; +} \ No newline at end of file