add docs, rename classes for clarity

This commit is contained in:
Art Lowel
2019-01-17 14:59:48 +01:00
parent e387f9446f
commit 586a4ac35b
23 changed files with 186 additions and 77 deletions

View File

@@ -86,7 +86,17 @@ function completeRequest(state: RequestState, action: RequestCompleteAction): Re
});
}
function resetResponseTimestamps(state: RequestState, action: ResetResponseTimestampsAction) {
/**
* Reset the timeAdded property of all responses
*
* @param state
* the current state
* @param action
* a RequestCompleteAction
* @return RequestState
* the new state, with the timeAdded property reset
*/
function resetResponseTimestamps(state: RequestState, action: ResetResponseTimestampsAction): RequestState {
const newState = Object.create(null);
Object.keys(state).forEach((key) => {
newState[key] = Object.assign({}, state[key],