Created
December 15, 2021 19:23
-
-
Save EvanBurbidge/1e6e1f65d9922b04423186d0457b07d5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const subscribeToPHoneData = async () => { | |
// fetch the phones url | |
const phones = await getData(PHONES_URL); | |
const phoneAvailabilityCheck = setInterval(async () => { | |
const { unavailableIds } = await getData(AVAILABILITY_URL); | |
changePhonesStatus(phones, unavailable); | |
// should return an object with the updated phone system | |
/* | |
if(someCondition) { clearInterval(phoneAvailabilityCheck) } | |
*/ | |
}, 1000); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment