Skip to content

Commit ae1f4ae

Browse files
CRANspection
1 parent 3e644e0 commit ae1f4ae

File tree

3 files changed

+53
-22
lines changed

3 files changed

+53
-22
lines changed

DESCRIPTION

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
Package: react
22
Title: Reactivity Helper for 'shiny'
3-
Version: 2024.1.1
3+
Version: 2024.1.0
44
Authors@R:
5-
person("Romain", "François", email = "[email protected]", role = c("aut", "cre"),
6-
comment = c(ORCID = "0000-0002-2444-4226"))
7-
Description: Tools to help with shiny reactivity. The 'react' object offers
5+
person("Romain", "François", email = "[email protected]", role = c("aut", "cre"))
6+
Description: Tools to help with 'shiny' reactivity. The 'react' object offers
87
an alternative way to call reactive expressions to better identify them
98
in the server code.
109
License: MIT + file LICENSE

R/react.R

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,33 @@
66
#' The benefit is that it makes them easier to spot in your code.
77
#'
88
#' @examples
9+
#' # This works by invoking the function from the parent environment
10+
#' # with no arguments ...
11+
#' foo <- function() {
12+
#' 42
13+
#' }
14+
#' react$foo
15+
#' react[foo]
16+
#' react[foo()]
17+
#'
918
#' \dontrun{
10-
#' # imagine you have some shiny reactive
11-
#' foo <- reactive({
12-
#' whatever() + something()
13-
#' })
19+
#' # ... but it only becomes relevant when used in shiny
20+
#' # server code, e.g. this app from the shiny page
21+
#' # with react$dataInput instead of dataInput()
22+
#' server <- function(input, output) {
23+
#'
24+
#' dataInput <- reactive({
25+
#' getSymbols(input$symb, src = "yahoo",
26+
#' from = input$dates[1],
27+
#' to = input$dates[2],
28+
#' auto.assign = FALSE)
29+
#' })
1430
#'
15-
#' # react allows you to call it in 3 different ways
16-
#' # instead of the usual foo() form
17-
#' react$foo
18-
#' react[foo]
19-
#' react[foo()]
31+
#' output$plot <- renderPlot({
32+
#' chartSeries(react$dataInput, theme = chartTheme("white"),
33+
#' type = "line", log.scale = input$log, TA = NULL)
34+
#' })
35+
#' }
2036
#' }
2137
#' @export
2238
react <- structure(list(), class = "react")

man/react.Rd

Lines changed: 25 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)