Reference Source
import SearchState from 'flarum/states/SearchState'
public class | source

SearchState

Constructor Summary

Public Constructor
public

Member Summary

Public Members
public
public

Method Summary

Public Methods
public

cache(query: string)

Mark that we have already searched for this query so that we don't have to ping the endpoint again.

public

clear()

Clear the search value.

public

If we are displaying the full results of a search (not just a preview), this value should return the query that prompted that search.

public
public

Check if this query has been searched before.

public

setValue(value: string)

Public Constructors

public constructor() source

Public Members

public cachedSearches: * source

public value: string source

Public Methods

public cache(query: string) source

Mark that we have already searched for this query so that we don't have to ping the endpoint again.

Params:

NameTypeAttributeDescription
query string

public clear() source

Clear the search value.

public getInitialSearch(): string source

If we are displaying the full results of a search (not just a preview), this value should return the query that prompted that search.

In this generic class, full page searching is not supported. This method should be implemented by subclasses that do support it.

Return:

string

public getValue(): string source

Return:

string

public isCached(query: string): boolean source

Check if this query has been searched before.

Params:

NameTypeAttributeDescription
query string

Return:

boolean

public setValue(value: string) source

Params:

NameTypeAttributeDescription
value string