Consider this HTML document:
<html> <head> <script type="text/tiscript"> var items = ["Veni","Vidi","Vici"]; </script> </head> <body> <reactor(ol)> {items.map((item) => <li>{item}</li>)} </reactor> </body> </html>
and note the <reactor>
element there. That <reactor> element is so called Reactor's mounting point.
When the <reactor>
element appears in the DOM it gets evaluated as a script containing SSX literals and the end result for that particular document will be this:
<html> <body> <ol> <li>Veni</li> <li>Vidi</li> <li>Vici</li> </ol> </body> </html>
The <reactor>
element knows about and interprets these two DOM attributes:
type
- string, accepts the following:src
- url. This attribute is used when the name defines Reactor's component (case #2 above). If src is provided then the engine will try to load component from script file loaded from the url.Example, this document:
<html> <head> <script type="text/tiscript"> var name = "World"; </script> </head> <reactor|body> <h1>Hello {name}</h1> </reactor> </html>
after loading will produce exactly this content:
<html> <head> <script type="text/tiscript"> var name = "World"; </script> </head> <body> <h1>Hello world</h1> </body> </html>