Glad to meet you all and to be here, currently I have a doubt that I am not understanding what is happening. Basicly I am mocking an api endpoint this way:
mockFetchStatus(): Observable<IStatus> {
const response = {
bad: 4,
normal: 5,
good: 7,
awesome: 12,
notExpected: 22,
};
console.log('response: ', response);
const obs: Observable<IStatus> = new Observable((subscriber) => {
setTimeout(() => {
subscriber.next({ ...response });
subscriber.complete();
}, 1000);
});
return obs;
}
When I log my response data there, it is out of order, it started like in the numbers order 4 to 22. I tried the same example on codepen and the order is keeped. What is wrong with this code, any help?