EVOLUTION-MANAGER
Edit File: domains.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Reactive domains</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for domains {shiny}"><tr><td>domains {shiny}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Reactive domains</h2> <h3>Description</h3> <p>Reactive domains are a mechanism for establishing ownership over reactive primitives (like reactive expressions and observers), even if the set of reactive primitives is dynamically created. This is useful for lifetime management (i.e. destroying observers when the Shiny session that created them ends) and error handling. </p> <h3>Usage</h3> <pre> getDefaultReactiveDomain() withReactiveDomain(domain, expr) onReactiveDomainEnded(domain, callback, failIfNull = FALSE) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>domain</code></td> <td> <p>A valid domain object (for example, a Shiny session), or <code>NULL</code></p> </td></tr> <tr valign="top"><td><code>expr</code></td> <td> <p>An expression to evaluate under <code>domain</code></p> </td></tr> <tr valign="top"><td><code>callback</code></td> <td> <p>A callback function to be invoked</p> </td></tr> <tr valign="top"><td><code>failIfNull</code></td> <td> <p>If <code>TRUE</code> then an error is given if the <code>domain</code> is <code>NULL</code></p> </td></tr> </table> <h3>Details</h3> <p>At any given time, there can be either a single "default" reactive domain object, or none (i.e. the reactive domain object is <code>NULL</code>). You can access the current default reactive domain by calling <code>getDefaultReactiveDomain</code>. </p> <p>Unless you specify otherwise, newly created observers and reactive expressions will be assigned to the current default domain (if any). You can override this assignment by providing an explicit <code>domain</code> argument to <code><a href="reactive.html">reactive()</a></code> or <code><a href="observe.html">observe()</a></code>. </p> <p>For advanced usage, it's possible to override the default domain using <code>withReactiveDomain</code>. The <code>domain</code> argument will be made the default domain while <code>expr</code> is evaluated. </p> <p>Implementers of new reactive primitives can use <code>onReactiveDomainEnded</code> as a convenience function for registering callbacks. If the reactive domain is <code>NULL</code> and <code>failIfNull</code> is <code>FALSE</code>, then the callback will never be invoked. </p> <hr /><div style="text-align: center;">[Package <em>shiny</em> version 1.5.0 <a href="00Index.html">Index</a>]</div> </body></html>