switch(name) {
case 'todoadded':
case 'todoremoved':
case 'todostatuschange':
this.updateTodoCounts();
break;
case 'statechanged':
this.updateSelectedFilterByUrl(data.url);
break;
}
Accidentally wrote 'todostatuschanged' instead of 'todostatuschange' (in keeping with the tense of all the other actions!) and you'll get a silent failure.
Or from isListCompleted() in the list module:
moduleEl.querySelectorAll('#todo-list li input[type="checkbox"]')
I'm not picking on T3, since all JavaScript frameworks seem to have this problem. There has to be a better way than that!
If you have static analysis then it makes sense to use types instead of strings. If you don't have static analysis then there isn't much motivation which is why you see strings everywhere in unanalyzed JavaScript.
Or from isListCompleted() in the list module:
I'm not picking on T3, since all JavaScript frameworks seem to have this problem. There has to be a better way than that!