ShinyModule: R6 Class that is the work horse of the shiny.forms package

Description Details Public fields Methods

Description

R6 Class that is the work horse of the shiny.forms package

R6 Class that is the work horse of the shiny.forms package

Details

This is to help modulize code in order to keep objects self contained, but also convienent to read from.

Public fields

id

element id that is assigned by the user. depending on how nested the module is, this may not be the id represented on the DOM due to namespacing of moduleServer

inner_id

an id that is used within $ui that is may be of some care for the user.

Methods

Public methods


Method new()

Create a ShinyModule object

Usage
ShinyModule$new(id)
Arguments
id

Set the value of $id field


Method call()

Call moduleServer which inacts this modules private$server function with $id as the namespace.

Usage
ShinyModule$call()

Method ui()

generate the UI associated with this ShinyModule object.

Usage
ShinyModule$ui(id = self$id)
Arguments
id

the id to use as a namespace from NS defaults to $id field.


Method remove()

Function to call to remove this ShinyModule's UI elements and clean up the server side input elements.

Usage
ShinyModule$remove(input, session)

Method reactive()

Function that when called, will create a reactive expression that returns a reference to this ShinyModule Object. Calling this function will enable reactivity on this object. This allows users to set fields as normal values and have more control over when a field should be updated.

Usage
ShinyModule$reactive()

Method invalidate()

Function used to invalidate the private reactive expression. This should only be called if $reactive has been called at the top of the app.

Usage
ShinyModule$invalidate()

Method upgrade()

If an ShinyModule object is ever cached to disk, and the corresponding package is updated with new methods, this function is used to update that object to a newer version if possible. This will call an internal S3 function named upgrade

Usage
ShinyModule$upgrade(...)
Arguments
...

additional arguments to be passed to the internal S3 upgrade method. This exists for future extensibility. For example


Method clone()

The objects of this class are cloneable with this method.

Usage
ShinyModule$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.


jtlandis/shiny.forms documentation built on Dec. 21, 2021, 4:13 a.m.