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

SearchState

Constructor Summary

Public Constructor
public

Member Summary

Public Members
public
public

Method Summary

Public Methods
public

cache(query: undefined)

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

getValue(): *

public

isCached(query: undefined): *

Check if this query has been searched before.

public

Public Constructors

public constructor() source

Public Members

public cachedSearches: * source

public value: string source

Public Methods

public cache(query: undefined) source

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

Params:

NameTypeAttributeDescription
query undefined

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(): * source

Return:

*

public isCached(query: undefined): * source

Check if this query has been searched before.

Params:

NameTypeAttributeDescription
query undefined

Return:

*

public setValue(value: undefined) source

Params:

NameTypeAttributeDescription
value undefined