Avoiding Duplication in State Management

State management is where small bugs grow up to become evil villains, rendering applications a nightmare to maintain. This is especially true when writing JavaScript to maintain UI state. It is tempting to create instance variables which maintain state which are then queried in template logic. For example: my-component.ts class MyComponent { language: string constructor(private myStore: MyStore) {} changeLanguage(lang: string) { // set this.language based on myStore } } my-component.html...

May 4, 2021