Table of Contents

Class FixedQuery<TArg, TResult>

Namespace
Phetch.Core
Assembly
Phetch.Core.dll

A class representing a query with a single (fixed) query argument.

public sealed class FixedQuery<TArg, TResult> : IDisposable

Type Parameters

TArg
TResult
Inheritance
FixedQuery<TArg, TResult>
Implements
Inherited Members

Properties

Arg

The argument that was passed to this query.

public TArg Arg { get; }

Property Value

TArg

Data

The data value returned from this query, or default it hasn't returned yet.

public TResult? Data { get; }

Property Value

TResult

Error

The exception thrown the last time this query failed, or null it has never failed.

public Exception? Error { get; }

Property Value

Exception

IsFetching

True if the query is currently running, either for the initial load or for subsequent fetches once the data is stale.

public bool IsFetching { get; }

Property Value

bool

Status

The current status of this query.

public QueryStatus Status { get; }

Property Value

QueryStatus

Methods

Dispose()

Removes this query from the cache.

public void Dispose()

Invalidate()

Invalidates this cache entry, causing it to be re-fetched if it is currently being used. If this cache entry is unused, it will be marked as invalidated and re-fetched as soon as it becomes used.

public void Invalidate()

UpdateQueryData(TResult)

Replaces the data for this cache entry. Any components using it will automatically receive the updated data.

public void UpdateQueryData(TResult resultData)

Parameters

resultData TResult