mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 22:16:40 +00:00
31 lines
667 B
JavaScript
31 lines
667 B
JavaScript
import { useRecoilState, atom } from 'recoil';
|
|
|
|
const transactionListState = atom({
|
|
key: 'transactionList',
|
|
default: [
|
|
{
|
|
id: 0,
|
|
amount: 300,
|
|
type: 'withdraw',
|
|
date: '3'
|
|
},
|
|
{
|
|
id: 1,
|
|
amount: 1000,
|
|
type: 'withdraw',
|
|
date: '3'
|
|
},
|
|
{
|
|
id: 2,
|
|
amount: 50,
|
|
type: 'transfer',
|
|
date: '2'
|
|
},
|
|
],
|
|
});
|
|
|
|
export const useBank = () => {
|
|
const [transactionList, setTransactionList] = useRecoilState
|
|
(transactionListState);
|
|
return { transactionList, setTransactionList };
|
|
} |