I'm diving into the world of RxJS and trying to grasp its concepts. During some testing, I encountered a puzzling issue that has me stumped.
Below is the snippet in question :
let item = { id: 1, name: 'chair' };
const asyncItem = timer(2000).pipe(() => of(item));
asyncItem.subscribe(data=>console.log(data))
I anticipated seeing item
displayed in the console after a 2-second delay, but strangely it appears instantly. Where am I going wrong? Grateful for any insights. Thanks.