From 0bd2be3001d897727e07d9d144cc9680869000bf Mon Sep 17 00:00:00 2001 From: bordun Date: Sat, 18 Apr 2020 12:13:46 +0200 Subject: [PATCH] docs: osc receivers array/object default value --- resources/docs/docs/widgets/advanced-syntaxes.md | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/resources/docs/docs/widgets/advanced-syntaxes.md b/resources/docs/docs/widgets/advanced-syntaxes.md index 4957a5eb..7b36f4c7 100644 --- a/resources/docs/docs/widgets/advanced-syntaxes.md +++ b/resources/docs/docs/widgets/advanced-syntaxes.md @@ -43,13 +43,20 @@ The inheritance syntax supports 1-level nesting : `@{fader_@{toggle_1}}` This syntax allows listening on an osc address to define a property. - `address`: osc address to listen to; if the leading slash (`/`) is omitted, the address will be prefixed with the widget's `address` property -- `default` (optional): default value returned before any message is received +- `default` (optional): default value returned before any message is received. Must be a primitive value, not an object or an array. - `usePreArgs` (optional): by default, osc listeners inherit the widget's `preArgs` and (these must be matched for the osc messages to be processed). Set to `false` bypass them. +Options can contain `@{}` blocks. -#### Dynamic address - -The `address` can contain `@{}` blocks +??? example "Array/Object default value" + ```js + JS{{ + return OSC{address} || { + "key a": 1, + "key b", 2 + } + }} + ``` ## Javascript: `JS{{ }}`