File

src/modules/generic-search/classes/generic-search.service.intf.ts

Description

Service to implement to use the Generic Search.

Index

Methods

Methods

Optional createNew
createNew()

Prepares everything that is needed for creating a new item

Returns : void
getSearchState
getSearchState()

Fetch the current search state from Redux

The Redux search state

resetSearchState
resetSearchState()

Reset the current search state in Redux

Returns : void
search
search(criteria: CriteriaType)

Performs the search with the given criteria

Parameters :
Name Type Optional Description
criteria CriteriaType No
  • The search criteria
Returns : Observable<SearchResultsType[]>

The search results

import { Observable } from "rxjs";
import { StarkSearchState } from "../entities";

/**
 * Service to implement to use the Generic Search.
 */
export interface StarkGenericSearchService<SearchResultsType, CriteriaType> {
	/**
	 * Prepares everything that is needed for creating a new item
	 */
	createNew?(): void;

	/**
	 * Fetch the current search state from Redux
	 * @returns The Redux search state
	 */
	getSearchState(): Observable<StarkSearchState<CriteriaType>>;

	/**
	 * Reset the current search state in Redux
	 */
	resetSearchState(): void;

	/**
	 * Performs the search with the given criteria
	 * @param criteria - The search criteria
	 * @returns The search results
	 */
	search(criteria: CriteriaType): Observable<SearchResultsType[]>;
}

results matching ""

    No results matching ""