GitHub

DaffCollectionFacade

An abstract class for a collection facade. It is configurable via its constructor parameters. The particular collection state from which this facade will read is determined by the selectors passed.

import { DaffCollectionFacade } from '@daffodil/core/state'
abstract class DaffCollectionFacade<<TState, TMetadata extends DaffCollectionMetadata = DaffCollectionMetadata>>  implements DaffCollectionFacadeInterface<TMetadata> {
  metadata$: Observable<TMetadata>
  request$: Observable<DaffCollectionRequest>
  count$: Observable<number>
  currentPage$: Observable<number>
  totalPages$: Observable<number>
  pageSize$: Observable<number>
  sortOptions$: Observable<DaffSortOption[]>
  appliedSortOption$: Observable<string>
  appliedSortDirection$: Observable<DaffSortDirectionEnum>
  filters$: Observable<DaffFilters>
  appliedFilters$: Observable<DaffFilters>
  protected store: Store<TState>
  dispatch(action: Action<string>)
}

Properties

Name Type Description
metadata$ Observable<TMetadata>

The page metadata for the collection.

request$ Observable<DaffCollectionRequest>

Builds a request that matches the current collection.

count$ Observable<number>

The number of items in the collection.

currentPage$ Observable<number>

The current page of items for the collection.

totalPages$ Observable<number>

The number of pages of items available in the collection.

pageSize$ Observable<number>

The number of items per page for the collection.

sortOptions$ Observable<DaffSortOption[]>

The sort options available for the items of the collection.

appliedSortOption$ Observable<string>

The sort options available for the items of the collection.

appliedSortDirection$ Observable<DaffSortDirectionEnum>

The sort options available for the items of the collection.

filters$ Observable<DaffFilters>

The filters available for the entities of the collection.

appliedFilters$ Observable<DaffFilters>

The sort options available for the entities of the collection.

store Store<TState>
dispatch

Dispatches the given action.