Created
October 25, 2019 20:23
-
-
Save sag1v/7db17297e9b5ccdc6ccf023b83534724 to your computer and use it in GitHub Desktop.
Markdium-React race condition bug
This file contains hidden or 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
| export function getPet(type) { | |
| const delay = type === "cats" ? 3500 : 500; | |
| return new Promise(resolve => { | |
| // immulate fetch call | |
| setTimeout(() => { | |
| resolve(petsDB[type]); | |
| }, delay); | |
| }); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment