mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 21:30:31 +00:00
17 lines
580 B
TypeScript
17 lines
580 B
TypeScript
// @ts-nocheck
|
|
import { useCallback } from "react";
|
|
import { useSelector, useDispatch } from "react-redux";
|
|
import { setOrganizations } from '@/store/organizations/organizations.actions';
|
|
import { getCurrentOrganizationFactory } from '@/store/authentication/authentication.selectors';
|
|
|
|
export const useSetOrganizations = () => {
|
|
const dispatch = useDispatch();
|
|
|
|
return useCallback((organizations) => {
|
|
dispatch(setOrganizations(organizations))
|
|
}, [dispatch]);
|
|
};
|
|
|
|
export const useCurrentOrganization = () => {
|
|
return useSelector(getCurrentOrganizationFactory())
|
|
}; |