我对可观察对象的管道有疑问
假设我有以下代码:
const skip$ = of(4);
const length$ = of(24);
const schoolId$ = of(1);
const source = combineLatest(skip$, length$, schoolId$).pipe(
map(([skip, length]) => `skip: ${skip}, length: ${length}`),
map(text => text ) // I need now schoolId, how can i get
);
在第二张地图中,我需要 schoolId。如果不这样做,我如何获得 schoolId:
const source = combineLatest(skip$, length$, schoolId$).pipe(
map(([skip, length, schoolId]) => ({text: `skip: ${skip}, length: ${length}`, schoolId})),
map(text => `${text.text}, schoolId: ${text.schoolId}` )
);
在这里,您可以尝试堆栈闪电战