I have some data and its processing code as follows:
LIST = [{
"id": "1lqgDs6cZdWBL",
"timeUpdated": "2020-04-22 12:51:23",
"status": "CLOSED"
}, {
"id": "C2Zl9JWfZHSJ",
"timeUpdated": "2020-04-22 12:51:07",
"status": "CLOSED"
}, {
"id": "BHbiVcCaQa2d",
"timeUpdated": "2020-04-15 14:53:12",
"status": "CLOSED"
}];
ngOnInit() {
this.initializeAlertTimer();
}
initializeAlertTimer(data?: any, duration?: any) {
const DURATION = duration ? 20000 : 1000
setTimeout(() => {
}, DURATION)
}
addData() {
const data = {
"id": "qHFw59mujN9X",
"timeCreated": "2020-03-06 12:21:06",
"status": "NEW",
}
this.initializeAlertTimer(data, 20000);
}
What I'm trying to do here is when opening the application it will list all the data LIST
from the console once even it will change a page or reload the page it shouldn't repeat and when clicking on the addData()
it will add the new data then by initializeAlertTime()
it will display the newest data.