afterDistinct( )


A hook triggered after a distinct query operation.

The afterDistinct() hook allows you to modify the results of the distinct query before they are returned to the caller. The hook is triggered for each value in the items array in the WixDataQueryResult object. The hook runs after the distinct query operation finishes and before the distinct() method returns.

Return a distinct value or a Promise that resolves to a distinct value.

If returning a Promise, the value is used as the result regardless of whether the Promise is fulfilled or rejected. A rejected Promise also triggers the onFailure() hook, if it has been registered.

Method Declaration
Copy
Method Parameters
valueanyRequired

Distinct query result value.


contextHookContextRequired

Contextual information about the hook.

Returns
Return Type:Promise<any> | any
Did this help?