Skip to content

Commit

Permalink
fix some typo
Browse files Browse the repository at this point in the history
  • Loading branch information
Victor Mendele committed May 14, 2021
1 parent 9f26b96 commit 180937b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
14 changes: 9 additions & 5 deletions docs/guide/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Getting started

> This documentation only cover the `v2` of this package which is
> in beta. `v2` has a lot of breaking chance.
> in beta. `v2` has a lot of breaking changes.
[![Build Status](https://travis-ci.org/botflux/dependency-injection-container.svg?branch=master)](https://travis-ci.org/botflux/dependency-injection-container)
[![npm version](https://img.shields.io/npm/v/@botflx%2Fdependency-injection-container.svg)](https://npmjs.org/package/@botflx/dependency-injection-container)
Expand All @@ -10,14 +10,14 @@
[![GitHub issues](https://img.shields.io/github/issues/botflux/dependency-injection-container.svg)](https://GitHub.com/botflux/dependency-injection-container/issues/)
[![GitHub license](https://img.shields.io/github/license/botflux/dependency-injection-container.svg)](https://github.com/botflux/dependency-injection-container/blob/master/LICENSE)

> In software engineering, dependency injection is a technique in which an object receives other objects that it depends on. These other objects are called dependencies. In the typical "using" relationship the receiving object is called a client and the passed (that is, "injected") object is called a service. The code that passes the service to the client can be many kinds of things and is called the injector. Instead of the client specifying which service it will use, the injector tells the client what service to use. The "injection" refers to the passing of a dependency (a service) into the object (a client) that would use it. [Source Wikipedia](https://en.wikipedia.org/wiki/Dependency_injection)
> In software engineering, dependency injection is a technique in which an object receives other objects that it depends on. These other objects are called dependencies. [Source Wikipedia](https://en.wikipedia.org/wiki/Dependency_injection)
This package exposes a dependency injection container that manage your
application dependencies.

## Simple example of dependency injection

The following code is an example of code without dependency injection.
The following example show some code without dependency injection.
We have two classes: `Engine` and `Car`. `Car` uses `Engine` in his `start` method.
In this example we can see that `Car` creates an `Engine` instance.

Expand Down Expand Up @@ -72,10 +72,14 @@ At his core dependency injection is just this: separating object creation and ob
> Keep in mind that you don't need this package to do dependency injection in fact
> you can use plain javascript / typescript.
## Why use a package to do dependency injection
## Why use a package to do dependency injection ?

This package gives a lightweight container that will helps you manage your dependencies, and their
life cycles. We can write the previous example with this package container.
life cycles. It will give you tools to simplify the creation of all your application dependencies.
This package tries to be simpler that other DI containers. If you are looking for a DI Container using a lot
of reflection and/or decorators you are not at the right place.

We can write the previous example with this package container.

```typescript
// classes.ts
Expand Down
2 changes: 1 addition & 1 deletion docs/guide/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ npm install --save @botflx/dependency-injection-container@beta
## Moving to monorepo

This package is currently moving to a monorepo structure.
In the future, extensions of this package will be published in the repo
In the future, extensions of this package will be published in the same repo
as the main package.

0 comments on commit 180937b

Please sign in to comment.