ASM_load_state: Write State to File for Saving

View source: R/ASM_Server.R

ASM_load_stateR Documentation

Write State to File for Saving

Description

Called from download handler and used to write a saved state value if that is null

Usage

ASM_load_state(state, session, file_path)

Arguments

state

ASM state from ASM_fetch_state()

session

Shiny session variable

file_path

Zip file with the saved sate

Value

This function only writes the state and returns a list with the following elements:

  • isgood: Boolean indicating the exit status of the function.

  • msgs: Messages to be passed back to the user.

  • state: AMS state

  • session: Session object

Examples

# Within shiny the session variable will exist
# this creates examples here for testing purposes:
sess_res = ASM_test_mksession()
session = sess_res$session
state   = sess_res$state

ssf  = tempfile(fileext=".zip")

ss_res =
ASM_save_state(state, session,
               file_path = ssf)

ls_res =
ASM_load_state(state, session,
               file_path = ssf)

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