-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
README.md finished, API finished for 1.0
- Loading branch information
Showing
23 changed files
with
771 additions
and
176 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 @@ | ||
README.md |
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
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,21 @@ | ||
import { Container } from "nwire" | ||
import { TasksCreator } from "./TasksCreator" | ||
import { createDatabase } from "./createDatabase" | ||
import { SQLiteTaskStore } from "./SQLiteTaskStore" | ||
|
||
export type AppContext = { | ||
db: Awaited<ReturnType<typeof createDatabase>> | ||
tasksCreator: TasksCreator | ||
tasks: SQLiteTaskStore | ||
} | ||
|
||
export async function createContext() { | ||
const database = await createDatabase() | ||
|
||
const context = Container.register("db", () => database) | ||
.instance("tasksCreator", TasksCreator) | ||
.instance("tasks", SQLiteTaskStore) | ||
.context<AppContext>() | ||
|
||
return context | ||
} |
Oops, something went wrong.