Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
darrachequesne committed Nov 21, 2023
1 parent 7c4678e commit ef64b2f
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 16 deletions.
@@ -1,5 +1,5 @@
import { io, Socket } from "socket.io-client";
import { ClientEvents, ServerEvents } from "../../../server/lib/events";
import { ClientEvents, ServerEvents } from "../../../common/events";
import { environment } from '../environments/environment';
import {Injectable} from "@angular/core";

Expand Down
Expand Up @@ -3,9 +3,7 @@
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "./out-tsc/app",
"types": [
"node"
]
"types": []
},
"files": [
"src/main.ts"
Expand Down
@@ -1,4 +1,10 @@
import { Todo, TodoID } from "./todo-management/todo.repository";
export type TodoID = string;

export interface Todo {
id: TodoID;
completed: boolean;
title: string;
}

interface Error {
error: string;
Expand Down
2 changes: 1 addition & 1 deletion examples/basic-crud-application/server/lib/app.ts
@@ -1,6 +1,6 @@
import { Server as HttpServer } from "http";
import { Server, ServerOptions } from "socket.io";
import { ClientEvents, ServerEvents } from "./events";
import { ClientEvents, ServerEvents } from "../../common/events";
import { TodoRepository } from "./todo-management/todo.repository";
import createTodoHandlers from "./todo-management/todo.handlers";

Expand Down
Expand Up @@ -2,8 +2,7 @@ import { Errors, mapErrorDetails, sanitizeErrorMessage } from "../util";
import { v4 as uuid } from "uuid";
import { Components } from "../app";
import Joi = require("joi");
import { Todo, TodoID } from "./todo.repository";
import { ClientEvents, Response, ServerEvents } from "../events";
import { Todo, TodoID, ClientEvents, Response, ServerEvents } from "../../../common/events";
import { Socket } from "socket.io";

const idSchema = Joi.string().guid({
Expand Down
@@ -1,4 +1,5 @@
import { Errors } from "../util";
import { Todo, TodoID } from "../../../common/events";

abstract class CrudRepository<T, ID> {
abstract findAll(): Promise<T[]>;
Expand All @@ -7,14 +8,6 @@ abstract class CrudRepository<T, ID> {
abstract deleteById(id: ID): Promise<void>;
}

export type TodoID = string;

export interface Todo {
id: TodoID;
completed: boolean;
title: string;
}

export abstract class TodoRepository extends CrudRepository<Todo, TodoID> {}

export class InMemoryTodoRepository extends TodoRepository {
Expand Down

0 comments on commit ef64b2f

Please sign in to comment.