-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9542b36
commit 4e236fd
Showing
10 changed files
with
58 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
export declare class DB { | ||
users: { | ||
username: string; | ||
}[]; | ||
} | ||
export declare const db: DB; |
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,14 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.db = exports.DB = void 0; | ||
class DB { | ||
constructor() { | ||
this.users = [ | ||
{ | ||
username: "tarek", | ||
} | ||
]; | ||
} | ||
} | ||
exports.DB = DB; | ||
exports.db = new DB(); |
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 @@ | ||
export declare const DiInit: () => void; |
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,10 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.DiInit = void 0; | ||
const injectx_1 = require("injectx"); | ||
const db_1 = require("./db"); | ||
const getUser_repository_1 = require("./getUser.repository"); | ||
const DiInit = () => { | ||
(0, injectx_1.GetContainer)('default').Bind(db_1.db, { name: 'db' }).Bind(getUser_repository_1.GetUserRepository); | ||
}; | ||
exports.DiInit = DiInit; |
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,7 @@ | ||
import { DB } from './db'; | ||
export declare const GetUserRepository: ({ db }: { | ||
db: DB; | ||
}) => (username: string) => { | ||
username: string; | ||
}; | ||
export declare const getUserReposistory: any; |
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 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getUserReposistory = exports.GetUserRepository = void 0; | ||
const injectx_1 = require("injectx"); | ||
const GetUserRepository = ({ db }) => (username) => { | ||
return db.users.find(user => user.username === username); | ||
}; | ||
exports.GetUserRepository = GetUserRepository; | ||
exports.getUserReposistory = (0, injectx_1.InjectIn)(exports.GetUserRepository); |
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 @@ | ||
export {}; |
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,6 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const diInit_1 = require("./diInit"); | ||
(0, diInit_1.DiInit)(); | ||
const getUser_repository_1 = require("./getUser.repository"); | ||
console.log((0, getUser_repository_1.getUserReposistory)("tarek")); |
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