ModStore | R Documentation |
This class is used to create a storage for tidymodules objects.
Manage applications, sessions and modules.
new()
Create a new ModStore object. Should be called once by the TidyModule class. Not to be called directly outside TidyModule. The ModStore object can be retrieved from any TidyModule object, see example below.
ModStore$new()
A new ModStore
object.
MyModule <- R6::R6Class("MyModule", inherit = tidymodules::TidyModule) m <- MyModule$new() s <- m$getStore()
isStored()
Check if a module is stored in the current session.
ModStore$isStored(m)
m
TidyModule object.
MyModule <- R6::R6Class("MyModule", inherit = tidymodules::TidyModule) m <- MyModule$new() s <- m$getStore() s$isStored(m)
getGlobalSession()
Retrieve the global session 'global_session'. This is the session that exists outside the application server function
ModStore$getGlobalSession()
getSession()
Retrieve a module session. This could be the global session or a user session.
ModStore$getSession(m)
m
TidyModule object.
getSessions()
Retrieve all sessions.
ModStore$getSessions()
getMods()
Retrieve all modules.
ModStore$getMods(m)
m
TidyModule object.
getEdges()
Retrieve modules connections.
ModStore$getEdges(m)
m
TidyModule object.
addEdge()
Add modules connections into ModStore. An edge is either a connection between a reactive object and a module or between two modules.
ModStore$addEdge(from, to, mode = "direct", comment = NA)
from
list with three elements: m -> module, type -> input or output, port -> port Id.
to
list with three elements: m -> module, type -> input or output, port -> port Id.
mode
The type of edge, default to 'direct'.
comment
Any additional comment.
delEdges()
Remove module edges
ModStore$delEdges(m)
m
TidyModule object.
addMod()
Add module into the ModStore.
ModStore$addMod(m)
m
TidyModule object.
delMod()
Delete a module from the ModStore.
ModStore$delMod(m)
m
TidyModule object.
print()
Print the ModStore object.
ModStore$print()
clone()
The objects of this class are cloneable with this method.
ModStore$clone(deep = FALSE)
deep
Whether to make a deep clone.
## ------------------------------------------------ ## Method `ModStore$new` ## ------------------------------------------------ MyModule <- R6::R6Class("MyModule", inherit = tidymodules::TidyModule) m <- MyModule$new() s <- m$getStore() ## ------------------------------------------------ ## Method `ModStore$isStored` ## ------------------------------------------------ MyModule <- R6::R6Class("MyModule", inherit = tidymodules::TidyModule) m <- MyModule$new() s <- m$getStore() s$isStored(m)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.