Skip to content

Commit

Permalink
Simplified empty params
Browse files Browse the repository at this point in the history
  • Loading branch information
davidjgonzalez committed Oct 31, 2023
1 parent 457be3d commit 3363916
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions react-app/src/api/usePersistedQueries.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ it.

import { useEffect, useState, useMemo } from "react";
import aemHeadlessClient from "./aemHeadlessClient";
import { parseArgs } from "util";

const emptyObject = useMemo({});
/**
* This file contains the React useEffect custom hooks that:
* 1. Are called by the React components
Expand Down Expand Up @@ -62,8 +60,6 @@ async function fetchPersistedQuery(persistedQueryName, queryParameters) {
* @returns an array of Adventure JSON objects, and array of errors
*/
export function useAdventuresByActivity(adventureActivity, params) {

params = params || emptyObject;
const [adventures, setAdventures] = useState(null);
const [errors, setErrors] = useState(null);

Expand Down Expand Up @@ -108,7 +104,6 @@ export function useAdventuresByActivity(adventureActivity, params) {
* @returns a JSON object representing the Adventure
*/
export function useAdventureBySlug(slugName, params) {
params = params || emptyObject;
const [adventure, setAdventure] = useState(null);
const [references, setReferences] = useState(null);
const [errors, setErrors] = useState(null);
Expand Down

0 comments on commit 3363916

Please sign in to comment.