Skip to content

Instantly share code, notes, and snippets.

@NetanelBasal
Created May 19, 2022 08:13
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 NetanelBasal/2bd389852bc50483edb4ed613fdc0b2c to your computer and use it in GitHub Desktop.
Save NetanelBasal/2bd389852bc50483edb4ed613fdc0b2c to your computer and use it in GitHub Desktop.
export function timespan$() {
const activatedRoute = inject(ActivatedRoute);
return activatedRoute.queryParams.pipe(
pluck('timespan'),
filterNil(),
distinctUntilChanged()
);
}
@Component({
selector: 'app-todo-page',
templateUrl: './todo-page.component.html'
})
export class TodoPageComponent {
data$ = timespan$().pipe(
switchMap(..)
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment