Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Update 'with' syntax

...

Code Block
languagejavascript
themeConfluence
with <var> = <expr> [[and] <var> = <expr>]* 

Any variable in a modifier clause is used (with its associated value) as an event parameter.  

...

Code Block
languagejavascript
themeConfluence
raise explicit event "foo"
  with a = "hello"
     and  b = 4 + x;
Info
titleEngine Compatibility

In the node pico engine, the modifier clause has this form (note, no "and"):

with <var> = <expr> [ <var> = <expr> ]*

making the example

raise explicit event "foo"

with a = "hello"

b = 4 + x

Attributes Clause

The attributes clause also allows the developer to add event attributes to the event. The expression that follows the attributes key word must evaluate to a map. The keys and values in the map will be used as event attributes. This is particularly useful when you want to pass through all, or most, of the attributes that the current rule received:

...

Code Block
languagejavascript
themeConfluence
raise explicit event "foo"
  with a = "hello"
      and b = 4 + x
      and _api = "sky";

Like any other postlude statement, explicit events can be guarded:

Code Block
languagejavascript
themeConfluence
raise explicit event "foo"
  with a = "hello"
   and    b = 4 + x
 if (flipper == "two");

...