## ----include = FALSE----------------------------------------------------------
knitr::opts_chunk$set(collapse = TRUE, comment = "#>", eval = FALSE)

## -----------------------------------------------------------------------------
# library(shiny)
# library(brochure)

## -----------------------------------------------------------------------------
# tags$a(href = "/contact", "Contact")

## -----------------------------------------------------------------------------
# page(
#   href = "/login",
#   ui = tagList(passwordInput("pw", "Password"), actionButton("go", "Log in")),
#   server = function(input, output, session) {
#     observeEvent(input$go, {
#       if (identical(input$pw, Sys.getenv("APP_PASSWORD"))) {
#         server_redirect("/")
#       }
#     })
#   }
# )

## -----------------------------------------------------------------------------
# store <- cachem::cache_disk()
# 
# brochureApp(
#   home(),
#   login()
# )

## -----------------------------------------------------------------------------
# page(
#   href = "/product/:sku",
#   ui = function(request) {
#     mod_product_ui("product")
#   },
#   server = function(input, output, session) {
#     mod_product_server("product", sku = get_keys()$sku)
#   }
# )

## -----------------------------------------------------------------------------
# # Read once, shared by every session
# reference <- readRDS(app_sys("data/reference.rds"))
# 
# # Or memoised, if it has to be fetched
# get_sales <- memoise::memoise(function(region) {
#   DBI::dbGetQuery(pool, "select * from sales where region = ?", list(region))
# })

