@heddendorp/effect-platform-angular 0.0.3 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -69,6 +69,8 @@ export class ProfileService {
|
|
|
69
69
|
|
|
70
70
|
This example shows the intended path for using Effect RPC over HTTP with Angular. It assumes you have a server exposing the Effect RPC HTTP protocol at `/rpc` and that `@effect/rpc` is installed in your app. The Angular service is the boundary where you stop Effect-style handling and return Promises to components, so components can inject the client and call procedures directly.
|
|
71
71
|
|
|
72
|
+
If you also want auto-generated TanStack Query + Mutation helpers with one injectable client, use `@heddendorp/effect-angular-query` on top of this transport layer.
|
|
73
|
+
|
|
72
74
|
```ts
|
|
73
75
|
import { inject, Injectable } from '@angular/core';
|
|
74
76
|
import { HttpClient } from '@effect/platform';
|
|
@@ -86,7 +88,9 @@ const Ping = Rpc.make('Ping', {
|
|
|
86
88
|
export class AppRpcs extends RpcGroup.make(Ping) {}
|
|
87
89
|
|
|
88
90
|
type PromiseClient<T> = {
|
|
89
|
-
-readonly [K in keyof T]: T[K] extends (
|
|
91
|
+
-readonly [K in keyof T]: T[K] extends (
|
|
92
|
+
...args: infer Args
|
|
93
|
+
) => Effect.Effect<infer A, infer _E, infer _R>
|
|
90
94
|
? (...args: Args) => Promise<A>
|
|
91
95
|
: never;
|
|
92
96
|
};
|