@domisoft/todo-clean-architecture
Version:
todo project following uncle bob clean architecture patterns
37 lines • 1.75 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
var todo_mock_dto_1 = require("../features/todo/data/repository/inmemory/dto/todo-mock.dto");
var todo_inmemory_repository_1 = require("../features/todo/data/repository/inmemory/todo.inmemory.repository");
var todo_default_presenter_1 = require("../features/todo/presentation/presenter/todo-default.presenter");
var TerminalApp = /** @class */ (function () {
function TerminalApp(todoRepository) {
this.todoRepository = todoRepository;
this.todoApp = new todo_default_presenter_1.TodoDefaultPresenter(this.todoRepository);
this.todoApp.todos$.subscribe(function (todos) {
console.log('todos', todos);
});
this.todoApp.activeTodosCount$.subscribe(function (todosCount) {
console.log('active todos count', todosCount);
});
this.todoApp.filter$.subscribe(function (filter) {
console.log('filter', filter);
});
}
TerminalApp.prototype.run = function () {
this.todoApp.getAllTodos();
this.todoApp.getCompletedTodos();
this.todoApp.getActiveTodos();
this.todoApp.addTodo('new todo');
this.todoApp.addTodo('another new todo');
this.todoApp.removeTodo('2');
};
return TerminalApp;
}());
exports.TerminalApp = TerminalApp;
var db = [
new todo_mock_dto_1.TodoMockDto({ id: '1', title: 'todo 1', completed: true }),
new todo_mock_dto_1.TodoMockDto({ id: '2', title: 'todo 2', completed: false }),
new todo_mock_dto_1.TodoMockDto({ id: '3', title: 'todo 3', completed: false }),
];
new TerminalApp(new todo_inmemory_repository_1.TodoInMemoryRepository(db)).run();
//# sourceMappingURL=main.app.js.map