I have a class, ChatRoom, that can only render after it receives a long-running HTTP request (it could take 1 second or 30 seconds). So I need to delay rendering un
ChatRoom
You could also achieve this using lodash's debouncer with recursion.
import _debounce from 'lodash/debounce'; const wait = (() => { if ( chatroom.json ) { chatroom.render(); } else { _debounce(wait, 500)(); } })();