const publicHolidayChecker = (country, year) => {
  let output
  fetch(`https://www.kayaposoft.com/enrico/json/v1.0/?action=getPublicHolidaysForYear&year=${year}&country=${country}`) // need to format
    .then(res => res.json())
    .then(json => output = json)
    })
    .catch(err => console.log({ err }))
  return output
}

export default publicHolidayChecker

const publicHolidayChecker = (country, year) => {
  return fetch(`https://www.kayaposoft.com/enrico/json/v1.0/?action=getPublicHolidaysForYear&year=${year}&country=${country}`)
    .then(res => res.json().length)
    .catch(err => console.log({ err }))
  }

export default publicHolidayChecker

return the fetch inside the publicHolidayChecker wrappers