Skip to content

Commit

Permalink
persist hideCompleted state
Browse files Browse the repository at this point in the history
  • Loading branch information
codypearce committed Sep 9, 2019
1 parent bb3c3b9 commit e5e7a35
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/pages/Home.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ import Question from "../ui/Question/Question";
import QuestionsHeader from "../ui/QuestionsHeader/QuestionsHeader";
import createPersistedState from "use-persisted-state";
const useItemsState = createPersistedState("items");
const useHideState = createPersistedState("hideCompleted");

const Home = () => {
const [items, setItems] = useItemsState([]);
const [hideCompleted, setHideCompleted] = useState(false);
const [hideCompleted, setHideCompleted] = useHideState(false);

const handleItems = questionId => {
if (items && items.find(item => item == questionId)) {
Expand Down

0 comments on commit e5e7a35

Please sign in to comment.