onRevisionGet
Revision retrieval handler
This example demonstrates how the onRevisionGet callback
retrieves a revision from an in-memory collection maintained by the host application using the provided revision key. Once the lookup is complete, the result is returned to
the widget through the
onResponse
callback.
Revision retrieval handler
onRevisionGet: (revisionKey: string, onResponse: (result: DIQ_Result, revision: DIQ_Revision | null) => void) => {
const revision = revisionStore.find(r => r.key === revisionKey);
if (revision) {
onResponse({ success: true }, revision);
} else {
onResponse({ success: false, error: "Revision not found" }, null);
}
}