Skip to content

Commit

Permalink
perf: reduce add product to basket debounce time
Browse files Browse the repository at this point in the history
  • Loading branch information
SGrueber authored and MaxKless committed Jul 27, 2022
1 parent 7175453 commit 243a567
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/app/core/store/customer/basket/basket-items.effects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export class BasketItemsEffects {
withLatestFrom(this.store.pipe(select(getProductEntities))),
map(([val, entities]) => ({ ...val, unit: entities[val.sku]?.packingUnit })),
// accumulate all actions
window(this.actions$.pipe(ofType(addProductToBasket), debounceTime(1000))),
window(this.actions$.pipe(ofType(addProductToBasket), debounceTime(500))),
mergeMap(window$ => window$.pipe(toArray())),
map(items => addItemsToBasket({ items }))
)
Expand Down

0 comments on commit 243a567

Please sign in to comment.