-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #327 from inversify/feat/update-next-getting-start…
…ed-docs-page Update next getting started docs page
- Loading branch information
Showing
36 changed files
with
212 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
...ages/docs/tools/inversify-code-examples/src/examples/v7/bindingOnSyntaxApiOnActivation.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
packages/docs/tools/inversify-code-examples/src/examples/v7/bindingScopeRequest.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
// Is-inversify-import-example | ||
import { Container, inject } from 'inversify7'; | ||
|
||
interface Weapon { | ||
|
1 change: 1 addition & 0 deletions
1
packages/docs/tools/inversify-code-examples/src/examples/v7/bindingScopeSingleton.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
// Is-inversify-import-example | ||
import { Container } from 'inversify7'; | ||
|
||
interface Weapon { | ||
|
1 change: 1 addition & 0 deletions
1
packages/docs/tools/inversify-code-examples/src/examples/v7/bindingScopeTransient.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
// Is-inversify-import-example | ||
import { Container } from 'inversify7'; | ||
|
||
interface Weapon { | ||
|
1 change: 1 addition & 0 deletions
1
packages/docs/tools/inversify-code-examples/src/examples/v7/bindingToSyntaxApiTo.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
// Is-inversify-import-example | ||
import { Container } from 'inversify7'; | ||
|
||
interface Weapon { | ||
|
1 change: 1 addition & 0 deletions
1
...s/docs/tools/inversify-code-examples/src/examples/v7/bindingToSyntaxApiToConstantValue.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
// Is-inversify-import-example | ||
import { Container } from 'inversify7'; | ||
|
||
interface Weapon { | ||
|
1 change: 1 addition & 0 deletions
1
...es/docs/tools/inversify-code-examples/src/examples/v7/bindingToSyntaxApiToDynamicValue.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
// Is-inversify-import-example | ||
import { Container } from 'inversify7'; | ||
|
||
interface Weapon { | ||
|
1 change: 1 addition & 0 deletions
1
packages/docs/tools/inversify-code-examples/src/examples/v7/bindingToSyntaxApiToFactory.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
// Is-inversify-import-example | ||
import { | ||
Container, | ||
Factory, | ||
|
1 change: 1 addition & 0 deletions
1
packages/docs/tools/inversify-code-examples/src/examples/v7/bindingToSyntaxApiToProvider.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
packages/docs/tools/inversify-code-examples/src/examples/v7/bindingToSyntaxApiToSelf.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
// Is-inversify-import-example | ||
import { Container } from 'inversify7'; | ||
|
||
interface Weapon { | ||
|
1 change: 1 addition & 0 deletions
1
packages/docs/tools/inversify-code-examples/src/examples/v7/bindingToSyntaxApiToService.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
// Is-inversify-import-example | ||
import { Container } from 'inversify7'; | ||
|
||
interface CardCatalogProvider<TCard> { | ||
|
1 change: 1 addition & 0 deletions
1
packages/docs/tools/inversify-code-examples/src/examples/v7/bindingWhenSyntaxApiWhen.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
// Is-inversify-import-example | ||
import { | ||
BindingMetadata, | ||
Container, | ||
|
1 change: 1 addition & 0 deletions
1
packages/docs/tools/inversify-code-examples/src/examples/v7/containerApiGet.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
// Is-inversify-import-example | ||
import { Container, injectable } from 'inversify7'; | ||
|
||
interface Weapon { | ||
|
1 change: 1 addition & 0 deletions
1
packages/docs/tools/inversify-code-examples/src/examples/v7/containerApiGetAll.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
// Is-inversify-import-example | ||
import { Container, injectable } from 'inversify7'; | ||
|
||
interface Weapon { | ||
|
1 change: 1 addition & 0 deletions
1
packages/docs/tools/inversify-code-examples/src/examples/v7/containerApiGetAllAsync.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
// Is-inversify-import-example | ||
import { Container, injectable } from 'inversify7'; | ||
|
||
interface Weapon { | ||
|
1 change: 1 addition & 0 deletions
1
packages/docs/tools/inversify-code-examples/src/examples/v7/containerApiGetAsync.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
// Is-inversify-import-example | ||
import { Container, injectable } from 'inversify7'; | ||
|
||
@injectable() | ||
|
1 change: 1 addition & 0 deletions
1
packages/docs/tools/inversify-code-examples/src/examples/v7/containerApiIsBound.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
// Is-inversify-import-example | ||
import { Container, injectable } from 'inversify7'; | ||
|
||
// Begin-example | ||
|
1 change: 1 addition & 0 deletions
1
packages/docs/tools/inversify-code-examples/src/examples/v7/containerApiIsCurrentBound.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
// Is-inversify-import-example | ||
import { Container, injectable } from 'inversify7'; | ||
|
||
// Begin-example | ||
|
1 change: 1 addition & 0 deletions
1
packages/docs/tools/inversify-code-examples/src/examples/v7/containerApiOnActivation.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
packages/docs/tools/inversify-code-examples/src/examples/v7/containerApiOnDeactivation.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
// Is-inversify-import-example | ||
import { Container } from 'inversify7'; | ||
|
||
void (async () => { | ||
|
1 change: 1 addition & 0 deletions
1
packages/docs/tools/inversify-code-examples/src/examples/v7/containerModuleApiExample.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
...cs/tools/inversify-code-examples/src/examples/v7/decoratorApiInjectConstructorArgument.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
// Is-inversify-import-example | ||
import { Container, inject, injectable } from 'inversify7'; | ||
|
||
interface Weapon { | ||
|
1 change: 1 addition & 0 deletions
1
packages/docs/tools/inversify-code-examples/src/examples/v7/decoratorApiInjectProperty.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
// Is-inversify-import-example | ||
import { Container, inject, injectable } from 'inversify7'; | ||
|
||
interface Weapon { | ||
|
1 change: 1 addition & 0 deletions
1
...ges/docs/tools/inversify-code-examples/src/examples/v7/decoratorApiMultiInjectProperty.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
packages/docs/tools/inversify-code-examples/src/examples/v7/decoratorApiNamed.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
packages/docs/tools/inversify-code-examples/src/examples/v7/decoratorApiOptional.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
packages/docs/tools/inversify-code-examples/src/examples/v7/decoratorApiPostConstruct.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
packages/docs/tools/inversify-code-examples/src/examples/v7/decoratorApiPreDestroy.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
// Is-inversify-import-example | ||
import { Container, preDestroy } from 'inversify7'; | ||
|
||
void (async () => { | ||
|
1 change: 1 addition & 0 deletions
1
packages/docs/tools/inversify-code-examples/src/examples/v7/decoratorApiTagged.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
packages/docs/tools/inversify-code-examples/src/examples/v7/decoratorApiUnmanaged.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
// Is-inversify-import-example | ||
import { Container, injectable, unmanaged } from 'inversify7'; | ||
|
||
@injectable() | ||
|
1 change: 1 addition & 0 deletions
1
packages/docs/tools/inversify-code-examples/src/examples/v7/fundamentalsBindingExample.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
// Is-inversify-import-example | ||
import { Container } from 'inversify7'; | ||
|
||
interface Weapon { | ||
|
9 changes: 9 additions & 0 deletions
9
packages/docs/tools/inversify-code-examples/src/examples/v7/gettingStarted.int.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { describe, expect, it } from '@jest/globals'; | ||
|
||
import { ninja } from './gettingStarted'; | ||
|
||
describe('getting started', () => { | ||
it('should provide a ninja with a weapon with right damage', () => { | ||
expect(ninja.katana.damage).toBe(10); | ||
}); | ||
}); |
27 changes: 27 additions & 0 deletions
27
packages/docs/tools/inversify-code-examples/src/examples/v7/gettingStarted.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// Is-inversify-import-example | ||
import { Container, inject, injectable } from 'inversify7'; | ||
|
||
@injectable() | ||
class Katana { | ||
public readonly damage: number = 10; | ||
} | ||
|
||
@injectable() | ||
class Ninja { | ||
constructor( | ||
@inject(Katana) | ||
public readonly katana: Katana, | ||
) {} | ||
} | ||
|
||
const container: Container = new Container(); | ||
|
||
container.bind(Ninja).toSelf(); | ||
container.bind(Katana).toSelf(); | ||
|
||
const ninja: Ninja = container.get(Ninja); | ||
|
||
console.log(ninja.katana.damage); // Prints 10 | ||
// End-example | ||
|
||
export { ninja }; |
Oops, something went wrong.