Skip to content

Commit c6e8747

Browse files
docs: fix grammar mistakes
1 parent 8d93b2d commit c6e8747

File tree

6 files changed

+17
-17
lines changed

6 files changed

+17
-17
lines changed

docs/typescript/01-getting-started.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import 'reflect-metadata';
2222
// comes here after you imported the reflect-metadata package!
2323
```
2424

25-
As a last step, you need to enable emitting decorator metadata in your Typescript config. Add these two lines to your `tsconfig.json` file under the `compilerOptions` key:
25+
As the last step, you need to enable emitting decorator metadata in your Typescript config. Add these two lines to your `tsconfig.json` file under the `compilerOptions` key:
2626

2727
```json
2828
"emitDecoratorMetadata": true,
@@ -34,7 +34,7 @@ Now you are ready to use TypeDI with Typescript!
3434
## Basic Usage
3535

3636
The most basic usage is to request an instance of a class definition. TypeDI will check if an instance of the class has
37-
been created before and return the cached version or it will create a new instance, cache and return it.
37+
been created before and return the cached version or it will create a new instance, cache, and return it.
3838

3939
```ts
4040
import { Container, Service } from 'typedi';

docs/typescript/02-basic-usage-guide.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ There are three ways to register your dependencies:
1212
- registering a value with a `Token`
1313
- registering a value with a string identifier
1414

15-
The `Token` and string identifier can be used to register other values than classes. Both tokens and string indentifiers
15+
The `Token` and string identifier can be used to register other values than classes. Both tokens and string identifiers
1616
can register any type of value including primitive values except `undefined`. They must be set on the container with the
1717
`Container.set()` function before they can be requested via `Container.get()`.
1818

@@ -140,7 +140,7 @@ _For detailed documentation about `Token` class please read the [Service Tokens]
140140
## Singleton vs transient classes
141141

142142
Every registered service by default is a singleton. Meaning repeated calls to `Container.get(MyClass)` will return the
143-
same instance. If this is not the desired behaviour a class can be marked as `transient` via the `@Service()` decorator.
143+
same instance. If this is not the desired behavior a class can be marked as `transient` via the `@Service()` decorator.
144144

145145
```ts
146146
import 'reflect-metadata';

docs/typescript/05-inject-decorator.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# The `@Inject` decorator
22

3-
The `@Inject()` decorator is a **property and parameter decorator** used to resolve dependencies on a property of a class or on a constructor parameter.
4-
By default it infers the type of the property or argument and initializes an instance of the detected type, however this behaviour can be overwritten via
5-
specifying a custom constructable type, `Token` or named service as the first parameter.
3+
The `@Inject()` decorator is a **property and parameter decorator** used to resolve dependencies on a property of a class or a constructor parameter.
4+
By default it infers the type of the property or argument and initializes an instance of the detected type, however, this behavior can be overwritten via
5+
specifying a custom constructable type, `Token`, or named service as the first parameter.
66

77
## Property injection
88

9-
This decorator is mandatory on properties where a class instance is desired (aka: without the decorator the property will stay undefined). The type of the
9+
This decorator is mandatory on properties where a class instance is desired (aka: without the decorator, the property will stay undefined). The type of the
1010
property is automatically inferred so there is no need to define the desired value as the decorator parameter.
1111

1212
```ts
@@ -45,8 +45,8 @@ console.log(instance.withoutDecorator);
4545

4646
## Constructor Injection
4747

48-
The `@Inject` decorator is not required in constructor injection, when a class is marked with the `@Service` decorator. TypeDI will automatically infer and
49-
inject the correct class instances for every constructor argument. However it can be used to overwrite the injected type.
48+
The `@Inject` decorator is not required in constructor injection when a class is marked with the `@Service` decorator. TypeDI will automatically infer and
49+
inject the correct class instances for every constructor argument. However, it can be used to overwrite the injected type.
5050

5151
```ts
5252
import 'reflect-metadata';
@@ -85,8 +85,8 @@ instance.withoutDecorator.print();
8585

8686
## Explicitly requesting target type
8787

88-
By default TypeDI will try to infer the type of the property and arguments and inject the proper class instance. However this is not always possible.
89-
(For example when a property type is an interface.) In these cases there are three way to overwrite type of the injected value:
88+
By default, TypeDI will try to infer the type of property and arguments and inject the proper class instance. When this is possible
89+
(eg: the property type is an interface) there is three-way to overwrite type of the injected value:
9090

9191
- via `@Inject(() => type)` where `type` is a constructable value (eg: a class definition)
9292
- via `@Inject(myToken)` where `myToken` is an instance of `Token` class

docs/typescript/06-service-tokens.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Service Tokens
22

3-
Service tokens are unique identifiers what provides a type-safe access to a value stored in a `Conatiner`.
3+
Service tokens are unique identifiers what provides type-safe access to a value stored in a `Container`.
44

55
```ts
66
import 'reflect-metadata';
@@ -21,7 +21,7 @@ const JWT_SECRET = Container.get(JWT_SECRET_TOKEN);
2121

2222
## Injecting service tokens
2323

24-
They can be used with the `@Inject()` decorator to overwrite the inferred type of the property of argument.
24+
They can be used with the `@Inject()` decorator to overwrite the inferred type of the property or argument.
2525

2626
```ts
2727
import 'reflect-metadata';
@@ -67,5 +67,5 @@ console.log(tokenValueA === tokenValueB);
6767

6868
### Difference between Token and string identifier
6969

70-
They both achieve the same goal, however it's recommended to use `Tokens` as they are type-safe and cannot be mistyped,
70+
They both achieve the same goal, however, it's recommended to use `Tokens` as they are type-safe and cannot be mistyped,
7171
while a mistyped string identifier will silently return `undefined` as value by default.

docs/typescript/07-inheritance.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Inheritance
22

33
Inheritance is supported **for properties** when both the base and the extended class is marked with the `@Service()` decorator.
4-
Classes which extends a class with decorated properties will receive the initialized class instances on those properties upon creation.
4+
Classes which extend a class with decorated properties will receive the initialized class instances on those properties upon creation.
55

66
```ts
77
import 'reflect-metadata';

docs/typescript/07-usage-with-typeorm.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Usage with TypeORM and routing-controllers
22

3-
In order to use TypeDI with routing-controllers and/or TypeORM, it's required to configure them to use the top-level
3+
To use TypeDI with routing-controllers and/or TypeORM, it's required to configure them to use the top-level
44
TypeDI container used by your application.
55

66
```ts

0 commit comments

Comments
 (0)