{"version":3,"sources":["lib/api.js","App.js","lib/hooks.js","reportWebVitals.js","index.js"],"names":["index","fetch","then","res","json","App","factories","loadFn","dependencies","useState","error","setError","fetching","setFetching","response","setResponse","asyncFetch","a","done","useEffect","catch","useMemo","useRemoteData","api","console","log","className","class","reportWebVitals","onPerfEntry","Function","getCLS","getFID","getFCP","getLCP","getTTFB","ReactDOM","render","StrictMode","document","getElementById"],"mappings":"2PAAO,SAASA,IACd,OAAOC,MAAM,UACVC,MAAK,SAAAC,GAAG,OAAIA,EAAIC,U,6CCuBNC,MAjBf,WACE,IAAMC,ECQD,SAAuBC,GAA4B,IAApBC,EAAmB,uDAAJ,GACnD,EAA0BC,mBAAS,MAAnC,mBAAOC,EAAP,KAAcC,EAAd,KACA,EAAgCF,mBAASD,IAAiB,IAA1D,mBAAOI,EAAP,KAAiBC,EAAjB,KACA,EAAgCJ,mBAAS,MAAzC,mBAAOK,EAAP,KAAiBC,EAAjB,KAHuD,SAUxCC,IAVwC,2EAUvD,sBAAAC,EAAA,+EACSV,KADT,4CAVuD,sBAcvD,SAASW,IACPL,GAAY,GAOd,OAjBAM,qBAAU,WACRN,GAAY,GACZG,IAAad,KAAKa,GAAaK,MAAMT,GAAUT,KAAKgB,KACnDV,GAUWa,mBAAQ,WACpB,MAAO,CAACX,QAAOE,WAAUE,cACxB,CAACJ,EAAOE,EAAUE,ID5BHQ,CAAcC,GAIhC,OAFAJ,qBAAU,WAAQK,QAAQC,IAAInB,KAAc,CAACA,IAG3C,sBAAKoB,UAAU,MAAf,UACE,iCACE,qBAAKC,MAAM,cAAX,uBAEF,+BACE,oDEPOC,EAZS,SAAAC,GAClBA,GAAeA,aAAuBC,UACxC,6BAAqB5B,MAAK,YAAkD,IAA/C6B,EAA8C,EAA9CA,OAAQC,EAAsC,EAAtCA,OAAQC,EAA8B,EAA9BA,OAAQC,EAAsB,EAAtBA,OAAQC,EAAc,EAAdA,QAC3DJ,EAAOF,GACPG,EAAOH,GACPI,EAAOJ,GACPK,EAAOL,GACPM,EAAQN,OCDdO,IAASC,OACP,cAAC,IAAMC,WAAP,UACE,cAAC,EAAD,MAEFC,SAASC,eAAe,SAM1BZ,M","file":"static/js/main.dace488a.chunk.js","sourcesContent":["export function index() {\n return fetch(\"./data\")\n .then(res => res.json());\n}\n","import { useEffect } from \"react\";\n\nimport './App.css';\nimport './layout.css';\n\nimport * as api from \"lib/api\";\nimport { useRemoteData } from \"lib/hooks\";\n\nfunction App() {\n const factories = useRemoteData(api.index);\n\n useEffect(() => { console.log(factories) }, [factories]);\n\n return (\n
\n
\n
testing
\n
\n
\n

Hello, world.

\n
\n
\n );\n}\n\nexport default App;\n","// useRemoteData -- fetch remote data with standardized fetching and error states\n//\n// USAGE\n//\n// function fetchMyData() {\n// // ... return your data or a promise for your data ...\n// }\n//\n// const data = useRemoteData(fetchMyData);\n// // -- OR --\n// const data = useRemoteData(fetchMyData, dependencies);\n//\n// Similar to `useEffect`, `dependencies` will trigger the fetch to occur again.\n// `dependencies` defaults to [], meaning the fetch will happen only once.\n\n\nimport { useEffect, useMemo, useState } from \"react\";\nexport function useRemoteData(loadFn, dependencies = []) {\n const [error, setError] = useState(null);\n const [fetching, setFetching] = useState(dependencies === []);\n const [response, setResponse] = useState(null);\n\n useEffect(() => {\n setFetching(true);\n asyncFetch().then(setResponse).catch(setError).then(done);\n }, dependencies);\n\n async function asyncFetch() {\n return loadFn();\n }\n\n function done() {\n setFetching(false);\n }\n\n const value = useMemo(() => {\n return {error, fetching, response};\n }, [error, fetching, response]);\n\n return value;\n}\n","const reportWebVitals = onPerfEntry => {\n if (onPerfEntry && onPerfEntry instanceof Function) {\n import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {\n getCLS(onPerfEntry);\n getFID(onPerfEntry);\n getFCP(onPerfEntry);\n getLCP(onPerfEntry);\n getTTFB(onPerfEntry);\n });\n }\n};\n\nexport default reportWebVitals;\n","import React from 'react';\nimport ReactDOM from 'react-dom';\nimport './index.css';\nimport App from './App';\nimport reportWebVitals from './reportWebVitals';\n\nReactDOM.render(\n \n \n ,\n document.getElementById('root')\n);\n\n// If you want to start measuring performance in your app, pass a function\n// to log results (for example: reportWebVitals(console.log))\n// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals\nreportWebVitals();\n"],"sourceRoot":""}