ASM_fetch_state: Fetch State Manager State

View source: R/ASM_Server.R

ASM_fetch_stateR Documentation

Fetch State Manager State

Description

Merges default app options with the changes made in the UI

Usage

ASM_fetch_state(id, input, session, FM_yaml_file, MOD_yaml_file)

Arguments

id

Shiny module ID

input

Shiny input variable

session

Shiny session variable

FM_yaml_file

App configuration file with FM as main section.

MOD_yaml_file

Module configuration file with MC as main section.

Value

list containing the current state of the app including default values from the yaml file as well as any changes made by the user. The list has the following structure:

  • yaml: Full contents of the supplied yaml file.

  • MC: Module components of the yaml file.

  • ASM:

    • isgood: Boolean object indicating if the file was successfully loaded.

    • checksum: This is an MD5 sum of the loaded state file

  • MOD_TYPE: Character data containing the type of module "ASM"

  • id: Character data containing the module id module in the session variable.

  • FM_yaml_file: App configuration file with FM as main section.

  • MOD_yaml_file: Module configuration file with MC as main section.

Examples

# Within shiny both session and input variables will exist,
# this creates examples here for testing purposes:
sess_res = ASM_test_mksession()
session = sess_res$session
input   = sess_res$input

# Configuration files
FM_yaml_file  = system.file(package = "formods", "templates", "formods.yaml")
MOD_yaml_file = system.file(package = "formods", "templates", "ASM.yaml")

# We need to specify the ID of the ASM module
id = "ASM"

state = ASM_fetch_state(id           = id,
                        input        = input,
                        session      = session,
                        FM_yaml_file = FM_yaml_file,
                        MOD_yaml_file = MOD_yaml_file)

state

formods documentation built on April 12, 2025, 1:57 a.m.