This article makes me feel very (type) unsafe. But seriously, I would not recommend this route unless
You use Typescript
Store each status as an enum.
The big issue I have is the inevatable instance where you spell 'loadng' instead of 'loading' and your logic breaks. This can be avoided using union types in typescript of creating an enum with regular JS.
This article makes me feel very (type) unsafe. But seriously, I would not recommend this route unless
The big issue I have is the inevatable instance where you spell 'loadng' instead of 'loading' and your logic breaks. This can be avoided using union types in typescript of creating an enum with regular JS.
That's why we should all move to TS :) oh and also I'd recommend union types instead of enums