Improving `flatMap` Usage and JSON Parsing in TypeScript Code

Is there anything I could do to be cleaner with this? Especially around the flatMap usage and the json parsing/decoding?
    const fetchPage = (name: string, params: QueryParams) =>
      pipe(
        Effect.try(() => makeUrl(name, params)),
        Effect.flatMap(zytePageFetcher.getPage),
        Effect.flatMap(Schema.decode(Schema.parseJson(RawRedditListing))),
        Effect.catchAll((e) => Effect.fail(new SpecialError(`Failed to get listing: ${e}`))),
      );
Was this page helpful?