DT
Size: a a a
DT
DT
Вキ
export const GetBookedTimeSlotsForBike = createAction(
'[Booking] Get booked time slots'
);
export const SetBookedTimeSlotsForBike = createAction(
'[Booking] Get booked time slots',
props<{bookedSlots: TimeSlotModel[]}>()
);
getBookedTimeSlotsForBike$ = createEffect(() =>
this.actions$.pipe(
ofType(BookingActions.GetBookedTimeSlotsForBike),
withLatestFrom(this.store.select(selectBookingBikeId)),
switchMap(([action, bikeId]) => this.riderService.getReservedTimeSlotsForBike(bikeId)
.pipe(
map((slots: TimeSlotModel[]) => BookingActions.SetBookedTimeSlotsForBike({bookedSlots: slots})),
catchError(err => this.handleError(err))
)
)
)
);
on(BookingActions.SetBookedTimeSlotsForBike,
(state, {bookedSlots}) => ({...state, bookedSlots})
)
DT
DT
DT
D
this.store$.pipe(
select(something),
map((stateSlice) => new SomeAction(stateSlice))
).subscribe(this.store$);
OS
.subscribe(this.store$);А что это за конструкция?
VB
VB
OS
.subscribe(this.store$);
==
.subscribe(action => this.store$(action));```?
OS
VB
VB
this.store$(action).bind(this)
OS
VB
OS
L
L
this.store$.pipe(
select(something),
map((stateSlice) => new SomeAction(stateSlice))
).subscribe(this.store$);
VB