Differences
This shows you the differences between two versions of the page.
Both sides previous revision
Previous revision
|
Last revision
Both sides next revision
|
blocks:app-note:interacting-from-a-custom-web-page [2021-08-31 17:15] mattias [PIXILAB Websocket API] |
blocks:app-note:interacting-from-a-custom-web-page [2022-09-22 09:54] admin Documented add can also do append |
=== pubSubPeer.add === | === pubSubPeer.add === |
| |
This is similar to the //set// function, and takes the same two parameters. However, it may only be used with numeric values. You can use it to increase or decrease (by passing a negative value) a numeric property, such as a volume value. This is often simpler for such incremental adjustments than maintaining a subscription to the value in order to do the calculation on the client side based on the current value and then using the //set// function to change the value. | This is similar to the //set// function, and takes the same two parameters. When used with a numeric property, the value you specify will be added to the current value. Pass a negative value to subtract. When used with a string property, the value will be //appended// (concatenated) to the current string value. |
| |
| The //add// methid is often simpler for such incremental adjustments than maintaining a subscription to the value in order to do the calculation on the client side based on the current value and then using the //set// function to change the value. |
| |
| |