Hacker News new | ask | show | jobs
by paavohtl 2616 days ago
I don't understand what you're trying to demonstrate with your example. Your TS(?) example is needlessly complicated, and syntactically invalid.

Here's a better TS implementation:

  togglePanel = (panelToggle: bool) => this.setState({ panelToggle })
1 comments

I agree, it wasn't a good example. More was (attempting) to make a point when inside a complex file, what I've seen. With long interface names mixed in with long variable names, contributing to larger files sizes than necessary. It varies depending on project/company. It's lowercase `boolean`.
You're right, sorry! I write TS every day at work but for some reason I sometimes forget which languages use bool and which use boolean ;)
<3