RicoSuter / NSwag

The Swagger/OpenAPI toolchain for .NET, ASP.NET Core and TypeScript.
http://NSwag.org
MIT License
6.67k stars 1.23k forks source link

TypeScript Client Generation Using RxJS 6 Observables Without Angular #1693

Open ideoclickVanessa opened 5 years ago

ideoclickVanessa commented 5 years ago

I'm currently working on a react project using redux-observable which is a redux middleware based on RxJS 6. As such, it would be awesome to be able to use the NSwagStudio to generate a TypeScript client using Observables based on RxJS 6 rather than being stuck using the Fetch (Promise-based) generator.

I've read through https://github.com/RSuter/NSwag/wiki/SwaggerToTypeScriptClientGenerator and didn't see it listed, so it's likely a feature request rather than it actually being possible now despite there being RxJS 6 support for Angular. Or, am I missing a setting that will decouple the current RxJS 6 client generation from the Angular client generation?

RicoSuter commented 5 years ago

No, this is not available yet

ideoclickVanessa commented 5 years ago

Any update on if/when this will be added?

It has risen in priority for me after discovering that pending fetch requests are not being correctly canceled when the Observable.switchMap() changes due to the fetch being Promise-based rather than Observable-based.

If it helps, observable-fetch seems to already exist: https://github.com/robinvdvleuten/observable-fetch