Cache redesign part 1, and add support for alternative links

This commit is contained in:
Art Lowel
2020-12-11 14:18:44 +01:00
parent f4853972cc
commit 4e18fa35ca
522 changed files with 7537 additions and 6933 deletions

View File

@@ -20,7 +20,7 @@ import { JsonPatchOperationModel, JsonPatchOperationType } from './json-patch.mo
*/
export interface JsonPatchOperationObject {
operation: JsonPatchOperationModel;
timeAdded: number;
timeCompleted: number;
}
/**
@@ -264,7 +264,7 @@ function flushOperation(state: JsonPatchOperationsState, action: FlushPatchOpera
newChildren = Object.assign({}, state[ action.payload.resourceType ].children, {
[action.payload.resourceId]: {
body: state[ action.payload.resourceType ].children[ action.payload.resourceId ].body
.filter((entry) => entry.timeAdded > state[ action.payload.resourceType ].transactionStartTime)
.filter((entry) => entry.timeCompleted > state[ action.payload.resourceType ].transactionStartTime)
}
});
} else {
@@ -278,7 +278,7 @@ function flushOperation(state: JsonPatchOperationsState, action: FlushPatchOpera
newChildren = Object.assign({}, newChildren, {
[resourceId]: {
body: newChildren[ resourceId ].body
.filter((entry) => entry.timeAdded > state[ action.payload.resourceType ].transactionStartTime)
.filter((entry) => entry.timeCompleted > state[ action.payload.resourceType ].transactionStartTime)
}
});
})
@@ -336,5 +336,5 @@ function addOperationToList(body: JsonPatchOperationObject[], actionType, target
}
function makeOperationEntry(operation) {
return { operation: operation, timeAdded: new Date().getTime() };
return { operation: operation, timeCompleted: new Date().getTime() };
}