The most common scenario for creating custom operators is to reuse the built-in operators shipped with RxJS. You'll find yourself re-using map
, filter
, and others will solve most of the problems you come across.
Can't get this to work as it's complaining about the value on the right hand side of the operator: "[ts] The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type."