Skip to content

Instantly share code, notes, and snippets.

To Switch or Not to Switch

You know, before Redux came out I had this idea in my head that the switch statement wasn't great. I don't think I was alone in thinking that either. I was under the impression that it was "preferred" or "best practice" to use object literals instead. For whatever reason, Redux seems to have repopularized switch for better or worse.

Old habits die hard. While reading through the tire icon util, I couldn't help but think all these switch statements could be replaced by simple object

When it looks like Jest isn't transpiling your code.

Try deleting Jest's cached transpiled files

cd $TMPDIR && rm -r jest_dx
@ttmarek
ttmarek / cloudSettings
Last active January 31, 2020 21:46
Visual Studio Code Settings Sync Gist
{"lastUpload":"2020-01-31T21:46:49.408Z","extensionVersion":"v3.4.3"}
// snippets