diff options
| author | real-zephex <[email protected]> | 2024-05-19 21:38:18 +0530 |
|---|---|---|
| committer | real-zephex <[email protected]> | 2024-05-19 21:38:18 +0530 |
| commit | f936d0bc251b2e931d0729198da115b00f5a44a1 (patch) | |
| tree | 8ce79c53a479038725e905245c2975bed27fc69e /src/app/web-series/components/cacher.js | |
| parent | style(homepage): removed unnecessary sub text from the homepage cards and cha... (diff) | |
| parent | Merge pull request #28 from real-zephex/improvement-2 (diff) | |
| download | dramalama-f936d0bc251b2e931d0729198da115b00f5a44a1.tar.xz dramalama-f936d0bc251b2e931d0729198da115b00f5a44a1.zip | |
Merge branch 'master' of https://github.com/real-zephex/Dramalama-Next
Diffstat (limited to 'src/app/web-series/components/cacher.js')
| -rw-r--r-- | src/app/web-series/components/cacher.js | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/app/web-series/components/cacher.js b/src/app/web-series/components/cacher.js new file mode 100644 index 0000000..3e2a197 --- /dev/null +++ b/src/app/web-series/components/cacher.js @@ -0,0 +1,19 @@ +import { SERIES_INFO } from "./data-fetch"; + +const PreFecthSeriesInfo = async (data) => { + try { + const fetchPromises = data.results.map(async (element) => { + await SERIES_INFO(element.id); + }); + + await Promise.all(fetchPromises); + console.log("Series info pre-fetched successfully!"); + } catch (error) { + console.error( + "Error occurred while pre-fetching series info page:", + error + ); + } +}; + +export default PreFecthSeriesInfo; |