This file contains hidden or 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
import { Todo } from '../entities'; | |
export abstract class TodoStorageService { | |
public abstract getTodos(): Todo[]; | |
public abstract saveTodos(todos: Todo[]): void; | |
} |
This file contains hidden or 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
import { Service, BasePresenter, Mediator } from '../framework'; | |
import { AppState, LoadTodosCommand, SaveTodosCommand, GetAllTodosQuery, ContainsAnyTodosQuery } from '../model'; | |
import { IAppView } from '../views'; | |
@Service() | |
export class AppPresenter extends BasePresenter<IAppView> { | |
constructor( | |
private readonly mediator: Mediator, | |
private readonly state: AppState | |
) { |
This file contains hidden or 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
// ... | |
describe('On toggle checkbox clicked', () => { | |
describe('when it is initially active', () => { | |
beforeEach(() => { | |
view.todo = activeTodo; | |
presenter.attach(view); | |
jest.clearAllMocks(); | |
}); | |
test('completes the todo', () => { |
This file contains hidden or 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
import { Component, Input, HostBinding, OnInit } from '@angular/core'; | |
import { Todo, TodoMixin, ITodoView, TodoPresenter, Injector } from '../../../../../app/src'; | |
import { BaseView } from 'src/app/base.view'; | |
@Component({ | |
selector: '[app-todo]', | |
templateUrl: 'todo.template.html', | |
styles: [] | |
}) | |
export class TodoComponent extends TodoMixin(BaseView) implements ITodoView, OnInit { |
This file contains hidden or 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
<div class="view"> | |
<input class="toggle" | |
type="checkbox" | |
[checked]="isCompleted" | |
(click)="onToggleCheckboxClicked()"> | |
<label (dblclick)="onDoubleClicked()">{{ todo.title }}</label> | |
<button class="destroy" (click)="onRemoveButtonClicked()"></button> | |
</div> | |
<input [(ngModel)]="todoTitleInput" | |
class="edit" |
This file contains hidden or 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
<script lang="ts"> | |
import { Component, Vue, Prop } from 'vue-property-decorator'; | |
import { Todo, ITodoView } from '../../../app/src'; | |
@Component | |
export class VueTodoMixin extends TodoMixin(Vue) {} | |
@Component({ | |
mixins: [VueTodoMixin] | |
}) |
OlderNewer