Board state can be preserved by serializing all contained objects and
restored via de-serialization. This mechanism can be used to power features
such as save/restore (via download, as implemented in the default
preserve_board plugin), but more refined user experience is conceivable
in terms of undo/redo functionality and (automatic) saving of board state.
Such enhancements can be implemented in a third-party preserve_board
module.
preserve_board(server = preserve_board_server, ui = preserve_board_ui)preserve_board_server(id, board, ...)
restore_board(x, new, result, ..., session = get_session())
preserve_board_ui(id, board)
serialize_board(x, blocks, id = NULL, ..., session = get_session())
A plugin container inheriting from preserve_board is returned by
preserve_board(), while the UI component (e.g. preserve_board_ui()) is
expected to return shiny UI (i.e. shiny::tagList()) and the server
component (i.e. preserve_board_server()) is expected to return a
shiny::reactiveVal() or shiny::reactive() which evaluates to NULL or a
board object.
Server/UI for the plugin module
Namespace ID
The initial board object
Extra arguments passed from parent scope
The current board object
Serialized (list-based) representation of the new board
A shiny::reactiveVal() to hold the new board object
Shiny session
Block state reactive values