1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
use wasm_bindgen::JsValue;

/// Available options for changing the state of the application
pub enum Msg {
    /// Set the URL path, starting with the first '/'
    SetPath(String),

    /// Set the contents of a specified entry by interpretting the pijul repository
    #[cfg(not(target_arch = "wasm32"))]
    SetEntryContents(String),
    /// Set the contents of a provided entry by deserializing the provided JSON
    SetEntryContentsJson(JsValue),
    /// Set the currently selected patch.
    /// If the value is `None`, use the current state or latest patch
    SetSelectedPatch(Option<String>),
    /// Toggle whether to render Markdown files in `FileView`
    ToggleRenderMd,
}