Skip to content

Modularise code #40

@fredjaya

Description

@fredjaya

Overview

This issue will track repetitive components that can be modularised.

  • 1. Updating of reactiveValues() (numerics) boundNumericInput() and saveNumericInput`
  • 2. Ditto, but with processOther()
  • 3. Validation
  • 4. numericInput with "Other"

1. Updating of reactiveValues()

Either updating numeric values (a):

  observeEvent(input$optsCostUnit, {
    costs$unit <- as.numeric(input$optsCostUnit)
  }, ignoreNULL = TRUE)

Inputs unit, pool, cluster, and period all share:

  • numericInput(inputId = ns(X), label, value = isolate(Y), min = 1e-6, step = 0.5)

And the UI, to make a module pair, is the above.

2. For processOther():

  observeEvent(input$optsPrevalence, {
    design_opts$prev <- processOther(input, "optsPrevalence")
  }, ignoreNULL = TRUE)

3. Validation

Where mod_ui = The error text displayed and mod_server = maybe

reactiveValues(
    exists = FALSE,
    valid = FALSE
)

where the validation logic should req(exists) to avoid propogating NULL etc.

4. numericInput with "Other"

e.g. Prevalence, Correlation, Sensitivity, Specificity

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions