...
This would place two notification boxes on the page.
Because this is so common, the keyword every
is optional, and so this could be written as
Code Block | ||||
---|---|---|---|---|
| ||||
if x > 5 then {
send_directive("Hello World!" + "This is my first message!");
send_directive("Hello Again!" + "This is my second message!");
} |
There is no limit to the number of actions that can be placed inside a compound action. While there is no linguistic restriction on mixing actions that send JavaScript and those that send directives, no current endpoint understands both directives and JavaScript, so that is not typically done.
Sample
Another kind of compound action is the sample
compound action. A sample
action takes a list of actions like every
, but instead of executing them all, it randomly picks one to execute. So, for example, the following would either send "This is one message!" or "This is another message!" randomly. The key reason for taking random action is to easily accommodate A/B behavior testing.
...