src/app/home/reducers/search.actions.ts
getAllFiltes |
getAllFiltes()
|
Defined in src/app/home/reducers/search.actions.ts:13
|
Returns:
Action
|
addFilter |
addFilter(taxon: any)
|
Defined in src/app/home/reducers/search.actions.ts:22
|
Parameters :
Returns:
Action
|
removeFilter |
removeFilter(taxon: any)
|
Defined in src/app/home/reducers/search.actions.ts:36
|
Parameters :
Returns:
void
|
Static ADD_FILTER |
ADD_FILTER: |
Default value: ADD_FILTER
|
Defined in src/app/home/reducers/search.actions.ts:5
|
Static GET_ALL_FILTERS |
GET_ALL_FILTERS: |
Default value: GET_ALL_FILTERS
|
Defined in src/app/home/reducers/search.actions.ts:4
|
Static REMOVE_FILTER |
REMOVE_FILTER: |
Default value: REMOVE_FILTER
|
Defined in src/app/home/reducers/search.actions.ts:6
|
import { Action } from '@ngrx/store';
export class SearchActions {
static GET_ALL_FILTERS = 'GET_ALL_FILTERS';
static ADD_FILTER = 'ADD_FILTER';
static REMOVE_FILTER = 'REMOVE_FILTER';
/**
* @method getAllFtilers
* Fetches all the filters that have been getSelectedProduct
* Used in filterSummaryComponent
*/
getAllFiltes(): Action {
return { type: SearchActions.GET_ALL_FILTERS };
}
/**
* @method addFilter
* @param taxon Class Taxon
* Get's triggered on checking the checkboxes in TaxonsComponent.
*/
addFilter(taxon: any): Action {
return {
type: SearchActions.ADD_FILTER,
payload: taxon
};
}
/**
* @method removeFilter
* @param taxon
* Get's triggered at 2 places:-
* 1. When user unchecks the checkbox.
* 2. When user clears the selected filtes in filterSummaryComponent
*/
removeFilter(taxon: any) {
return {
type: SearchActions.REMOVE_FILTER,
payload: taxon
};
}
}