14 lines
356 B
JavaScript
14 lines
356 B
JavaScript
import { useContext } from 'react';
|
|
import { CurrentGroupContext } from '../CurrentGroupProvider.jsx';
|
|
import { groupChange } from '../reducers/CurrentGroupReducer.jsx';
|
|
|
|
const useGroup = () => {
|
|
const { dispatch } = useContext(CurrentGroupContext);
|
|
|
|
return {
|
|
groupChange: (group) => dispatch(groupChange(group)),
|
|
};
|
|
};
|
|
|
|
export default useGroup;
|