Rewriting the test suit revealed some edge-cases which were previously not accounted for . . .
Update the status of our State. ie isRequested, isResolved, isRejected, etc. These atributes are inherited from the record at the state's current readOffset.
setReadOffset(index) must have an index greater than zero. If we set the readOffset to anything less than zero, the state assumes a readOffset of zero.
setReadOffset(index) must have an index less than state.length if state.stats.totalPages is known. If we set the readOffset to anything greater than or equal to state.length, a warning is issued. If the minLoadHorizon extends into valid records in the dataset, we will still fetch those records. However, since the current state.readOffset is out of bounds, the state carries the following attributes:
state.isRequested //=> false
state.isPending //=> false
state.isResolved //=> false
state.isRejected //=> false
state.isSettled //=> false
The record inherits the error of the record's page
state.get(index) of an Out Of Bounds index returns a Record Object which is Unrequested, which has an Unrequested Page, and whose content is empty.
Rewriting the test suit revealed some edge-cases which were previously not accounted for . . .
state.length
ifstate.stats.totalPages
is known. If we set the readOffset to anything greater than or equal tostate.length
, a warning is issued. If the minLoadHorizon extends into valid records in the dataset, we will still fetch those records. However, since the currentstate.readOffset
is out of bounds, the state carries the following attributes:state.isRequested //=> false
state.isPending //=> false
state.isResolved //=> false
state.isRejected //=> false
state.isSettled //=> false