mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-19 14:20:31 +00:00
re-structure to monorepo.
This commit is contained in:
17
packages/webapp/src/hooks/state/organizations.tsx
Normal file
17
packages/webapp/src/hooks/state/organizations.tsx
Normal file
@@ -0,0 +1,17 @@
|
||||
// @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())
|
||||
};
|
||||
Reference in New Issue
Block a user