Some time after this blog post was written, Anders Hejlsberg opened a PR that preserves type aliases for union and intersection types. That PR’s changes should included in TypeScript 4.2, so when that version is released, the reasons for preferring interfaces might be less compelling.
Recently, I noticed a Twitter…
Recently, I replaced an ESLint rule that was specific to arrays —
no-array-foreach — with a more general rule —…
RxJS — and Rx in general — offers a bunch of guarantees that make it possible to compose observable chains. Specifically, it’s guaranteed that:
I thought I’d write up a short post to explain a TypeScript problem that took up far too much of my time.
The TL;DR is that if you have overload signatures for a function that takes a variable number of (initial) arguments, the ordering of the signatures matters in a…
publishReplay operators can be called in two ways: either with or without a selector function. Let’s look at the differences and at why you should almost always pass a selector.
publish is called without a selector, it returns a particular type of observable: a
Introducing unintentional dependencies on
rxjs-compat is something that I see developers doing every now and then. Let’s have a look at
rxjs-compat to see what it is, how it works and how depending upon it can be avoided.
If you’re only interested in avoiding the dependency, skip to the TL;DR…
In RxJS version 6.4.0, a change was made to the
shareReplay operator. Let’s look at why the operator needed to be changed, what was changed and how the change can be used to avoid surprises — and bugs.
If you’re only interested in the change, skip to the TL;DR at…
When pipeable operators were introduced in RxJS version 5.5, writing user-land operators became much simpler.
A pipeable operator is a higher-order function: a function that returns another function. And the function that is returned takes an observable and returns an observable. So, to create an operator, you don’t have to…
I often see code that looks a little like this:
Which seems fine.
Well, it is fine — as long as the
handleError methods do not depend upon the
this context in their implementations.
When unbound methods are passed to RxJS, they will be invoked with an…