HackerTrans
TopNewTrendsCommentsPastAskShowJobs

wingspan

no profile record

Submissions

Early gunpowder was made from the 'pisse' of church ladies

chicagoreader.com
4 points·by wingspan·há 11 meses·0 comments

Please Stop Using Barrel Files

tkdodo.eu
5 points·by wingspan·há 2 anos·1 comments

comments

wingspan
·há 4 anos·discuss
I was able to reproduce this in a simple example [1]. If you refresh it a few times you will be able to see it flash (at least I did in Chrome on Mac). It is probably more noticeable if you set it up as an SPA with a page transition, but I wanted to keep the example simple.

[1] https://codesandbox.io/s/recursing-glitter-h4c83u?file=/src/...
wingspan
·há 4 anos·discuss
I love this approach and have used it many times in JavaScript. I often end up adding an additional map in front with the resolved values to check first, because awaiting or then'ing a Promise always means you will wait until the next microtask for the value, instead of getting it immediately. With a framework like React, this means you'll have a flash of missing content even when it is already cached.