Skip to content

Commit ca23155

Browse files
committed
clarify buildOnChange per Jan
1 parent cf8c8b3 commit ca23155

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

articles/api-management/developer-portal-extend-custom-functionality.md

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ titleSuffix: Azure API Management
44
description: How to customize the managed API Management developer portal with custom functionality such as custom widgets.
55
author: dlepow
66
ms.author: danlep
7-
ms.date: 08/09/2022
7+
ms.date: 08/25/2022
88
ms.service: api-management
99
ms.topic: how-to
1010
---
@@ -147,7 +147,7 @@ This [npm package](https://www.npmjs.com/package/@azure/api-management-custom-wi
147147
|---------|---------|
148148
|[getValues](#azureapi-management-custom-widgets-toolsgetvalues) | Returns a JSON object containing values set in the widget editor combined with default values |
149149
|[getEditorValues](#azureapi-management-custom-widgets-toolsgeteditorvalues) | Returns a JSON object containing only values set in the widget editor |
150-
|[buildOnChange](#azureapi-management-custom-widgets-toolsbuildonchange) | Takes one parameter: a JSON object with updated values; returns a function to update the widget values |
150+
|[buildOnChange](#azureapi-management-custom-widgets-toolsbuildonchange) | Accepts a TypeScript type and returns a function to update the widget values. The returned function takes as parameter a JSON object with updated values and doesn't return anything.<br/><br/>Used internally in widget editor |
151151
|[askForSecrets](#azureapi-management-custom-widgets-toolsaskforsecrets) | Returns a JavaScript promise, which after resolution returns a JSON object of data needed to communicate with backend |
152152
|[deployNodeJs](#azureapi-management-custom-widgets-toolsdeploynodejs) | Deploys widget to blob storage |
153153
|[getWidgetData](#azureapi-management-custom-widgets-toolsgetwidgetdata) | Returns all data passed to your custom widget from the developer portal<br/><br/>Used internally in templates |
@@ -173,11 +173,15 @@ It's intended to be used in the editor of your widget but also works in runtime.
173173

174174
#### `@azure/api-management-custom-widgets-tools/buildOnChange`
175175

176-
This function is intended to be used only in the widget editor. It takes one parameter: a JSON object with updated values. It returns a function to update the widget values.
176+
> [!NOTE]
177+
> This function is intended to be used only in the widget editor.
178+
179+
Accepts a TypeScript type and returns a function to update the widget values. The returned function takes as parameter a JSON object with updated values and doesn't return anything.
177180

178181
```JavaScript
179-
const onChange = buildOnChange()
180-
onChange({fieldKey: 'newValue'})
182+
import {Values} from "./values"
183+
const onChange = buildOnChange<Values>()
184+
onChange({fieldKey: 'newValue'})
181185
```
182186

183187
#### `@azure/api-management-custom-widgets-tools/askForSecrets`
@@ -206,7 +210,8 @@ It accepts three arguments by default:
206210

207211
#### `@azure/api-management-custom-widgets-tools/getWidgetData`
208212

209-
This function is used internally in templates. In most implementations you shouldn't need it otherwise.
213+
> [!NOTE]
214+
> This function is used internally in templates. In most implementations you shouldn't need it otherwise.
210215
211216
This function returns all data passed to your custom widget from the developer portal. It contains other data that might be useful in debugging or in more advanced scenarios. This API is expected to change with potential breaking changes. It returns a JSON object that contains the following keys:
212217

0 commit comments

Comments
 (0)