Loading

class Loading<T>(data: T? = null) : Resource<T>

Represents a loading state with optional cached data.

This state indicates that an operation is in progress. The optional data parameter allows you to show cached/stale data while fetching fresh data from the network.

Parameters

T

The type of data.

data

Optional cached data to display during loading (null for initial load).

Constructors

Link copied to clipboard
constructor(data: T? = null)

Properties

Link copied to clipboard
val data: T?

The data result of the operation (can be null for initial loading states).

Link copied to clipboard

The error that occurred during the operation (only set in Error state).