mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 04:40:32 +00:00
feat: add connect to bank dialog
This commit is contained in:
20
packages/webapp/src/hooks/state/banking.ts
Normal file
20
packages/webapp/src/hooks/state/banking.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import { getPlaidToken, setPlaidId } from '@/store/banking/banking.reducer';
|
||||
import { useCallback } from 'react';
|
||||
import { useDispatch, useSelector } from 'react-redux';
|
||||
|
||||
export const useSetBankingPlaidToken = () => {
|
||||
const dispatch = useDispatch();
|
||||
|
||||
return useCallback(
|
||||
(plaidId: string) => {
|
||||
dispatch(setPlaidId(plaidId));
|
||||
},
|
||||
[dispatch],
|
||||
);
|
||||
};
|
||||
|
||||
export const useGetBankingPlaidToken = () => {
|
||||
const plaidToken = useSelector(getPlaidToken);
|
||||
|
||||
return plaidToken;
|
||||
};
|
||||
Reference in New Issue
Block a user