mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
835987b78b
Instead of the deprecated tslint use eslint in the aio's example-lint script PR Close #43218
22 lines
635 B
TypeScript
22 lines
635 B
TypeScript
// #docplaster
|
|
/*
|
|
Because of how the code is merged together using the doc regions,
|
|
we need to indent the imports with the function below.
|
|
*/
|
|
// #docregion interval
|
|
import { interval } from 'rxjs';
|
|
|
|
// #enddocregion interval
|
|
|
|
export function docRegionInterval(console: Console) {
|
|
// #docregion interval
|
|
// Create an Observable that will publish a value on an interval
|
|
const secondsCounter = interval(1000);
|
|
// Subscribe to begin publishing values
|
|
const subscription = secondsCounter.subscribe(n =>
|
|
console.log(`It's been ${n + 1} seconds since subscribing!`));
|
|
|
|
// #enddocregion interval
|
|
return subscription;
|
|
}
|