147 followers 0 articles/week
Testing 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 extremely easy to test your reducers - which control state changes - and respond to actions accordingly. Another reason to adopt the Redux pattern with...

Mon Feb 12, 2018 17:43
Testing 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 contents Testing Actions What we’ll test Spec File Creating an instance Assertions Testing Actions Ideally,...

Thu Feb 8, 2018 22:11
Angular 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, we’ll explore class bindings, and also Angular’s NgClass directive, the syntaxes and also some best practice ideas. Table of contents Property...

Thu Jan 18, 2018 09:09
Typing 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 of this article, we’ll simply use a TypeScript class to demonstrate how we can declare some of these properties, in the various forms. ...

Mon Jan 15, 2018 09:07
Step 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 essentially create a pure function, which accepts an input and returns a different output via some form of transformation. That’s the essence of a Pipe....

Sun Jan 14, 2018 10:13
Handling 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 Observables that somewhat pull in data (over perhaps, Http). There are also a few tricks we can use to mitigate common async issues, whilst being productive...

Sat Jan 13, 2018 14:15

Build your own newsfeed

Ready to give it a go?
Start a 14-day trial, no credit card required.

Create account