function Gallery() {
    const { dispatch } = useContext(EmployeeContext);
  
    useEffect(() => {
        loadEmployees();
    },[]);

    function loadEmployees() {
        API.getEmployeesList()
            .then(employees => {
                dispatch({type: ALL_EMPLOYEES, payload: employees});
            })
            .catch(err => console.log(err));
  };

  return (
      <div>
          <Container />
      </div>
  );
}
// for our employee directory page displaying the data through the API call
for our employee directory page displaying the data through the API call
for our employee directory page displaying the data through the API call
function Gallery() {
    const { dispatch } = useContext(EmployeeContext);
    useEffect(() => {
        loadEmployees();
    },[]);
    function loadEmployees() {
        API.getEmployeesList()
            .then(employees => {
                dispatch({type: ALL_EMPLOYEES, payload: employees});
            })
            .catch(err => console.log(err));
  };
  return (
      <div>
          <Container />
      </div>
  );
}
function Gallery ( ) { const { dispatch } = useContext ( EmployeeContext ) ; useEffect ( ( ) => { loadEmployees ( ) ; } , [ ] ) ; function loadEmployees ( ) { API . getEmployeesList ( ) . then ( employees => { dispatch ( { type : ALL_EMPLOYEES , payload : employees } ) ; } ) . catch ( err => console . log ( err ) ) ; } ; return ( < div > < Container / > < / div > ) ; }
for our employee directory page displaying the data through the API call
for our employee directory page displaying the data through the API call