Ready State
Ready State
Whenever Relay is fulfilling data requirements, it can be useful to know when certain events occur. For example, we might want to record how long it takes for data to be available, or we might want to log errors to the server. These events are available on most Relay APIs via the onReadyStateChange
callback.
onReadyStateChange
When Relay fulfills data, the onReadyStateChange
callback is called one or more times with an object that describes the current "ready state". This object has the following properties:
-
ready: boolean
This is true when the subset of data required for rendering is ready.
-
done: boolean
This is true when all data requirements are ready for rendering.
-
error: ?Error
This is an instance of
Error
if there is a failure. O