sercrod

*update

*update refreshes a target Sercrod host after the current host or element updates. It is the preferred name for this behavior. *updated-propagate remains available as a compatibility alias.

The value is a literal routing spec, not a JavaScript expression. Use root, a numeric Sercrod-host depth, or a selector.

Parent refresh example

<serc-rod id="parent" data='{"message":"parent_message"}'>
  <serc-rod data='{"child_message":"hello"}'>
    <button
      @click="$parent.message = child_message"
      *update="2">
      Send to parent
    </button>
  </serc-rod>

  <p *print="message"></p>
</serc-rod>

Here the button is inside the child Sercrod host. The nearest host is 1, and the parent host is 2. After the click changes parent data, *update="2" refreshes the parent view.

Numeric rule

More detail

*update can be written on a Sercrod host or on an ordinary element inside a host. It runs after *updated on the same host or element.

For older templates, *updated-propagate and n-updated-propagate remain compatibility aliases. New templates should prefer *update.