mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 22:16:40 +00:00
working typescript version
This commit is contained in:
1 parent
581d6011e0
commit
cff746aa38
119 files changed
+247
-189
No files matched your search
File renamed without changes.
File renamed without changes.
@@ -1,31 +0,0 @@
|
||||
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 };
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
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 };
|
||||
};
|
||||
Reference in new issue
Block a user