Closed slevens-atlas closed 2 years ago
I have a branch with the changes ready if someone can give me contributor access I can open a PR and attach to review.
You are missing the "stale while invalidate" model, when you can have old data
while loading
a new one.
However it will be very useful to know a single state
of a given resource: loading, stale, error, arrived(🤷♂️).
This makes a lot of sense, maybe we could include a state key and expose keys based on that? Could potentially be too rigid though. Otherwise if we are happy with the current implementation I can close this issue.
I'm going to close this issue. I think it is fine in its current state and leave it up to the dev to determine how they want to handle it
The current implementation of
RouteResourceResponseBase
includes adata
key which will always benull
as defined in https://github.com/atlassian-labs/react-resource-router/blob/a4e0f0358c9987f5b0398ac76deaf491a96ce308/src/controllers/resource-store/constants.ts#L8I suggest we remove the key entirely and let it only be set by the response successfully returning data.
This will have the flow on effect of improving the typescript checking and will force developers to check
loading
anderror
before thedata
key will even appear.Like this: