remote-data-ts
remote-data-ts copied to clipboard
Question about pending state
How to separate state when I do first loading, and show skeleton, and second+ loading, when I don't want to hide my content, is it possible?
Simply put your data in a separate variable and update it when the response was returned.
So instead of using a single RemoteData
object would do some like this:
// Before
type Response = RemoteData<Error, Data>
// After
interface Response {
data: Option<Data> // Is None on first load
request: RemoteData<Error, void> // You can remove data from the RemoteData object or keep it twice.
}