-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
const [sunSign, setSunSign]=useState(''); /* My sunSign state variable is set to an empty value because this value depends on what the user chooses so I didn't want there to be a set value. */ const [sunSignData, setSunSignData]=useState(null) const [loading, setLoading]=useState(false); /* My loading state variable is initialized to false so I could toggle between states by passing boolean value. False loading will hold the current value of the state and setLoading will let me change it */ // const [link, setLinkView]=useState(false); const [displayCard, setDisplayCard]=useState(false); const [reading, getReading]=useState(false); useEffect(() => { setLoading(true); const url = `https://aztro.sameerkumar.website/?sign=${sunSign}&day=today`; fetch(url, { method: 'POST' }) .then((res) => res.json()) .then((data) => setSunSignData(data)) .then(() => setLoading(false)); }, [sunSign]); const handleSelection = (event) => { setSunSign(event.target.value); } if (loading === true) { return '...Loading, wait one moment, please.'; } // const handleSelection = (event) => { // setSunSign(event.target.value); // } return ( SELECT YOUR SIGN Capricorn Aquarius Pisces Taurus Gemini Cancer Leo Virgo Libra Scorpio Sagittarius ) }