INNER CODE UNIT · JavaScript

goalItems

datastax-archive/workshop-graphql-netflix · src/App.js:34

    const goalItems = pageSize * requestedPage
    const currentItems = (genres || []).length
    const bottomReached = currentItems > 0 && pageState === null
    // we ask for more genres if we are not at bottom of infinite scroll
    // (and if there are less items than the nominally requested pages)
    if ((goalItems > currentItems) && !bottomReached){
      fetchData()
    }
    // eslint-disable-next-line react-hooks/exhaustive-deps
  }, [requestedPage])

  return (
    <>
      <NavBar />
      <HeroSection />
      {genres && (
        <div className="container">
          {Object.values(genres).map((genre) => (

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…