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...
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,...
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...
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. ...
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....
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...
Build your own newsfeed
Ready to give it a go?
Start a 14-day trial, no credit card required.