I am trying to figure out how to schedule a method in my code using rxjs/timer
. Specifically, I want the method to run at precisely 10 AM
after an initial delay of 1 minute
. However, my current implementation is running every 2 minutes after a 1-minute delay. This is not the desired functionality. Can anyone provide guidance on achieving the desired behavior or suggest an alternative approach?
import { timer } from 'rxjs/observable/timer';
timer(60000, 120000).subscribe(val => {//schedule Notification
myMethod();
});