I have a custom RxJS operator that maps data that comes back from our API. Here's the Operator:
export function mapActionResult(): OperatorFunction<ActionResult<any>, any> {
return map((data: ActionResult<any>) => data.result);
}
// in use:
getData() {
return this._http.get(this.someUrl).pipe(
mapActionResult()
)
}
I would like to get the ActionResult<any> typed but am not sure how to do that. The ActionResult interface takes a generic to type it properly, so I'm hoping to be able to type this operator as well.