This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useEffect, useState } from 'react'; | |
import { fetchEmployees } from '../api/employees'; | |
const EmployeeSearchContainer = (props) => { | |
const [selectedEmployee, setSelectedEmployee] = useState(null); | |
const [isLoading, setIsLoading] = useState(false); | |
const [searchText, setSearchText] = useState(''); | |
const [employees, setEmployees] = useState([]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useEffect, useState, useMemo } from 'react'; | |
import { fetchEmployees } from '../api/employees'; | |
const EmployeeSearchContainer = (props) => { | |
const [selectedEmployee, setSelectedEmployee] = useState(null); | |
const [isLoading, setIsLoading] = useState(false); | |
const [searchText, setSearchText] = useState(''); | |
const [employees, setEmployees] = useState([]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { createSlice } from '@reduxjs/toolkit'; | |
// Make an initial state for Redux | |
const initialVotingPollSlice = { | |
votedPollIds: [], | |
canVote: false, | |
currentVote: null | |
}; | |
// Create a slice using RTK |