Skip to content

Commit c61593f

Browse files
committed
docs(content): add missing pluralisation
Signed-off-by: Stanislas Lange <[email protected]>
1 parent 28ee7a9 commit c61593f

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

content/microservices/grpc.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -237,16 +237,16 @@ Once registered, we can inject the configured `ClientGrpc` object with `@Inject(
237237
```typescript
238238
@Injectable()
239239
export class AppService implements OnModuleInit {
240-
private heroService: HeroesService;
240+
private heroesService: HeroesService;
241241

242242
constructor(@Inject('HERO_PACKAGE') private client: ClientGrpc) {}
243243

244244
onModuleInit() {
245-
this.heroService = this.client.getService<HeroesService>('HeroesService');
245+
this.heroesService = this.client.getService<HeroesService>('HeroesService');
246246
}
247247

248248
getHero(): Observable<string> {
249-
return this.heroService.findOne({ id: 1 });
249+
return this.heroesService.findOne({ id: 1 });
250250
}
251251
}
252252
```
@@ -267,23 +267,23 @@ export class AppService implements OnModuleInit {
267267
})
268268
client: ClientGrpc;
269269

270-
private heroService: HeroesService;
270+
private heroesService: HeroesService;
271271

272272
onModuleInit() {
273-
this.heroService = this.client.getService<HeroesService>('HeroesService');
273+
this.heroesService = this.client.getService<HeroesService>('HeroesService');
274274
}
275275

276276
getHero(): Observable<string> {
277-
return this.heroService.findOne({ id: 1 });
277+
return this.heroesService.findOne({ id: 1 });
278278
}
279279
}
280280
```
281281

282282
Finally, for more complex scenarios, we can inject a dynamically configured client using the `ClientProxyFactory` class as described <a href="/microservices/basics#client">here</a>.
283283

284-
In either case, we end up with a reference to our `HeroesService` proxy object, which exposes the same set of methods that are defined inside the `.proto` file. Now, when we access this proxy object (i.e., `heroService`), the gRPC system automatically serializes requests, forwards them to the remote system, returns a response, and deserializes the response. Because gRPC shields us from these network communication details, `heroService` looks and acts like a local provider.
284+
In either case, we end up with a reference to our `HeroesService` proxy object, which exposes the same set of methods that are defined inside the `.proto` file. Now, when we access this proxy object (i.e., `heroesService`), the gRPC system automatically serializes requests, forwards them to the remote system, returns a response, and deserializes the response. Because gRPC shields us from these network communication details, `heroesService` looks and acts like a local provider.
285285

286-
Note, all service methods are **lower camel cased** (in order to follow the natural convention of the language). So, for example, while our `.proto` file `HeroesService` definition contains the `FindOne()` function, the `heroService` instance will provide the `findOne()` method.
286+
Note, all service methods are **lower camel cased** (in order to follow the natural convention of the language). So, for example, while our `.proto` file `HeroesService` definition contains the `FindOne()` function, the `heroesService` instance will provide the `findOne()` method.
287287

288288
```typescript
289289
interface HeroesService {
@@ -297,12 +297,12 @@ A message handler is also able to return an `Observable`, in which case the res
297297
@@filename(heroes.controller)
298298
@Get()
299299
call(): Observable<any> {
300-
return this.heroService.findOne({ id: 1 });
300+
return this.heroesService.findOne({ id: 1 });
301301
}
302302
@@switch
303303
@Get()
304304
call() {
305-
return this.heroService.findOne({ id: 1 });
305+
return this.heroesService.findOne({ id: 1 });
306306
}
307307
```
308308

0 commit comments

Comments
 (0)