onListConstants
Constant listing handler
This example demonstrates how the onListConstants callback
retrieves all constants contained within a constant folder from the host application's persistent storage. Once the constants have been retrieved, they are returned to the
widget through the
onResponse
callback.
Constant listing handler
onListConstants: (folder: DIQ_ConstantFolder, onResponse: (result: DIQ_Result, constants: Array<DIQ_Constant> | null) => void) => {
// Retrieve all constants for the folder
const constants = database.getConstants(folder.key);
// Return the constants to the widget
onResponse(
{ success: true },
constants
);
},