3 ms·
The problem with frontend is that making code synchronous blocks the client—even if it's something that "should be" synchronous. If it's anything more complex t
by sotojuan 10y ago
The problem with frontend is that making code synchronous blocks the client—even if it's something that "should be" synchronous. If it's anything more complex than a loop or a map through an array, it's recommended you make it async.
- BinaryIdiot 10y agoMaking something asynchronous doesn't do anything magical to unblock the client; a long running asynchronous call that's not accessing an external resource will block the client just as much with the only differencing being the scheduler gets freed up just before running the asynchronous code. If you have something long running you need to use a generator yield pattern (process in pieces with ES5). I addressed this in my initial comment.