DaffProductRoutingCollectionEffects
An abstract class that provides an effect for modifying the browser URL.
import { DaffProductRoutingCollectionEffects } from '@daffodil/product/routing'
abstract class DaffProductRoutingCollectionEffects {
update$: createEffect(() => this.actions$.pipe(ofType(...this.actionTypes), withLatestFrom(this.facade.metadata$), map(([action, metadata]): [Action, DaffCollectionRequest] => [
action,
{
filterRequests: daffFiltersToRequests(metadata.filters),
appliedSortOption: metadata.appliedSortOption,
appliedSortDirection: metadata.appliedSortDirection,
currentPage: metadata.currentPage,
pageSize: metadata.pageSize
},
]), tap(([action, request]) => this.router.navigate([], {
relativeTo: this.route,
queryParams: this.getQueryParams.getQueryParams(request),
queryParamsHandling: 'merge'
})), switchMap(() => EMPTY)), { dispatch: false })
}
Properties
Name | Type | Description |
---|---|---|
update$ | createEffect(() => this.actions$.pipe(ofType(...this.actionTypes), withLatestFrom(this.facade.metadata$), map(([action, metadata]): [Action, DaffCollectionRequest] => [ action, { filterRequests: daffFiltersToRequests(metadata.filters), appliedSortOption: metadata.appliedSortOption, appliedSortDirection: metadata.appliedSortDirection, currentPage: metadata.currentPage, pageSize: metadata.pageSize }, ]), tap(([action, request]) => this.router.navigate([], { relativeTo: this.route, queryParams: this.getQueryParams.getQueryParams(request), queryParamsHandling: 'merge' })), switchMap(() => EMPTY)), { dispatch: false }) | Updates the URL according to the product collection request in state. |