NGRX Store: Understanding State Selectors
Selectors are pure functions that take slices of state as arguments and return some state data that we can pass to our components. To better understand what selectors are and what they do, it helps see...
View ArticleClasses vs Interfaces in TypeScript
Classes and interfaces are powerful structures that facilitate not just object-oriented programming but also type-checking in TypeScript. A class is a blueprint from which we can create objects that...
View ArticleIntroduction to TypeScript
Since its inception, JavaScript has experienced monumental growth - especially in recent years.The language has expanded its application domain far beyond the browser. It is now used to power backends,...
View ArticleAngular's NgIf, Else, Then - Explained
Using the ngIf directive allows us to simply toggle content based on a conditional. But is it as simple as we think? Not quite, the directive has a heap of helpful syntaxes that can help us deal with...
View ArticleHandling Observables with NgIf and the Async Pipe
Dealing with async operations with the async pipe takes care of subscribing to Observable streams/async stuff like Promises for us.There are a few common gotchas when dealing with purely cold...
View ArticleStep by Step Custom Pipes in Angular
Angular has many Pipes built-in, but they only take us so far. Ideally we’d like to extend our applications by creating custom Pipes.Custom Pipes (previously Filters in AngularJS) allow us to...
View ArticleTyping Arrays in TypeScript
There are many ways we can type a property to declare to TypeScript something is an array, or contains an array of “something”. We have generic types, array types and type assertions.For the purposes...
View ArticleAngular Classes with NgClass
With Angular, we have many approaches to adding, removing, toggling classes. We can choose single classes and bind a property, or we can use the awesome NgClass directive from Angular.In this post,...
View ArticleTesting Actions in NGRX Store
In this small NGRX Store testing series, we’re going to learn how to test Actions, Reducers and Selectors. Let’s begin with Actions, or more specifically Action Creators and how to test them.Table of...
View ArticleTesting Reducers in NGRX Store
Next in this series, we’re going to learn how to test Reducers in NGRX Store. In the previous testing post we explored Testing Actions.As we know, Reducers are just pure functions. This makes it...
View Article