Skip to content

Instantly share code, notes, and snippets.

@greetclock
Last active July 17, 2022 15:15
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/e3dcca64bdbebaa50d776ba614f8d81f to your computer and use it in GitHub Desktop.
Save greetclock/e3dcca64bdbebaa50d776ba614f8d81f to your computer and use it in GitHub Desktop.
// https://github.com/greetclock/parts/blob/3eec90/libs/todos-data/src/lib/todos-facade.service.ts
// that's a simplified gist of the original facade. Follow the link to see the whole thing.
import { todos$ } from './todos.repository'
import { TodosDataService } from './todos-data.service'
export class TodosFacadeService {
todos$: Observable<Todo[]> = todos$
constructor(
private todosData: TodosDataService
) {}
getTodos(): Observable<Todo[]> {
const todos$ = this.todosData.getTodos()
todos$.subscribe()
return todos$
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment