Created
July 17, 2022 15:10
-
-
Save greetclock/04eb1880ceb9ab985b81e11d5ab04293 to your computer and use it in GitHub Desktop.
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
// https://github.com/greetclock/parts/blob/d97018/libs/todos-data/src/lib/todos-data.service.ts | |
@Injectable({ | |
providedIn: 'root', | |
}) | |
export class TodosDataService { | |
constructor( | |
private todosAdapter: TodosAdapterService, | |
private todosRepo: TodosRepository, | |
) {} | |
getTodos(): Observable<Todo[]> { | |
return this.todosAdapter | |
.getTodos() | |
.pipe(tap((todos) => this.todosRepo.setTodos(todos))) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment