Stop using isLoading booleansMarch 2nd, 2020 — 9 min read Let's play around with the Geolocation API a bit and learn about the perils of isLoading booleans (and similar booleans like: isRejected, isIdle, or isResolved) while we're at it. I'll be using React to demonstrate this, but the concepts apply generally to any framework or language. function geoPositionReducer(state, action) { switch (actio
![Stop using isLoading booleans](https://cdn-ak-scissors.b.st-hatena.com/image/square/17bdc34eb53b7f3dc50abbf63384ad34e018f133/height=288;version=1;width=512/https%3A%2F%2Fres.cloudinary.com%2Fkentcdodds-com%2Fimage%2Fupload%2F%24th_1256%2C%24tw_2400%2C%24gw_%24tw_div_24%2C%24gh_%24th_div_12%2Fco_rgb%3Aa9adc1%2Cc_fit%2Cg_north_west%2Cw_%24gw_mul_14%2Ch_%24gh%2Cx_%24gw_mul_1.5%2Cy_%24gh_mul_1.3%2Cl_text%3Akentcdodds.com%3AMatter-Regular.woff2_50%3ACheck%252520out%252520this%252520article%2Fco_white%2Cc_fit%2Cg_north_west%2Cw_%24gw_mul_13.5%2Ch_%24gh_mul_7%2Cx_%24gw_mul_1.5%2Cy_%24gh_mul_2.3%2Cl_text%3Akentcdodds.com%3AMatter-Regular.woff2_110%3AStop%252520using%252520isLoading%252520booleans%2Fc_fit%2Cg_north_west%2Cr_max%2Cw_%24gw_mul_4%2Ch_%24gh_mul_3%2Cx_%24gw%2Cy_%24gh_mul_8%2Cl_kent%3Aprofile-transparent%2Fco_rgb%3Aa9adc1%2Cc_fit%2Cg_north_west%2Cw_%24gw_mul_5.5%2Ch_%24gh_mul_4%2Cx_%24gw_mul_4.5%2Cy_%24gh_mul_9%2Cl_text%3Akentcdodds.com%3AMatter-Regular.woff2_70%3AKent%2520C.%2520Dodds%2Fco_rgb%3Aa9adc1%2Cc_fit%2Cg_north_west%2Cw_%24gw_mul_9%2Cx_%24gw_mul_4.5%2Cy_%24gh_mul_9.8%2Cl_text%3Akentcdodds.com%3AMatter-Regular.woff2_40%3Akentcdodds.com%25252Fblog%25252Fstop-using-isloading-booleans%2Fc_fill%2Car_3%3A4%2Cr_12%2Cg_east%2Ch_%24gh_mul_10%2Cx_%24gw%2Cl_unsplash%3Aphoto-1533928298208-27ff66555d8d%2Fc_fill%2Cw_%24tw%2Ch_%24th%2Fkentcdodds.com%2Fsocial-background.png)