Skip to content

Instantly share code, notes, and snippets.

@greetclock
Created July 17, 2022 15:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save greetclock/04eb1880ceb9ab985b81e11d5ab04293 to your computer and use it in GitHub Desktop.
Save greetclock/04eb1880ceb9ab985b81e11d5ab04293 to your computer and use it in GitHub Desktop.
// 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