#How am i gonna send request live-server when dateTime is matched?
17 messages · Page 1 of 1 (latest)
In my opinion the backend should have some kind of Job's that are executed on a period of time, and check if there are sales that end today.
1st param can be either number or date and according to description:
... or a Date until which the emission of the source items is delayed.
it should delay emission until provided date
also example from docs
import { fromEvent, delay } from 'rxjs';
const clicks = fromEvent(document, 'click');
const date = new Date('March 15, 2050 12:00:00'); // in the future
const delayedClicks = clicks.pipe(delay(date)); // click emitted only after that date
delayedClicks.subscribe(x => console.log(x));
ohh so, delay operator can also allow the date
yes and it basically calculates number of ms between current date and provided and sets a delay
so no magic or periodically executed jobs
thats soo coool man❤️
just setTimeout
it make it so easy for the future actions