Coder Social home page Coder Social logo

react's Introduction

react

R-CMD-check

The goal of react is to help with reactivity, instead of calling the foo reactive expression foo() you can call react$foo similar to how one calls input$bar for inputs, or alternatively react[foo] or react[foo()].

The benefit is that it makes it easier to spot calls to reactive expressions in your server code.

Installation

You can install the development version of react from GitHub with:

pak::pak("tadascience/react")

Examples

Take this from the shiny example:

server <- function(input, output) {

  dataInput <- reactive({
    getSymbols(input$symb, src = "yahoo",
               from = input$dates[1],
               to = input$dates[2],
               auto.assign = FALSE)
  })

  output$plot <- renderPlot({
    chartSeries(dataInput(), theme = chartTheme("white"),
                type = "line", log.scale = input$log, TA = NULL)
  })

}

With react you can rewrite the plot output as one of these, depending on your taste.

  # react$ is similar conceptually to how input$ works
  output$plot <- renderPlot({
    chartSeries(react$dataInput, theme = chartTheme("white"),
                type = "line", log.scale = input$log, TA = NULL)
  })
  
  # react[] 
  output$plot <- renderPlot({
    chartSeries(react[dataInput], theme = chartTheme("white"),
                type = "line", log.scale = input$log, TA = NULL)
  })
  
  # react[()] so that you still have the calling a function feel
  #           and you just sourround it
  output$plot <- renderPlot({
    chartSeries(react[dataInput()], theme = chartTheme("white"),
                type = "line", log.scale = input$log, TA = NULL)
  })
  

react's People

Contributors

romainfrancois avatar

Stargazers

Shinya Uryu avatar  avatar Marcin Dubel avatar Uğur Dar avatar Alejandro Abraham avatar Jinhwan Kim avatar

react's Issues

🌱 Release react 2024.4.1

Prepare for release:

  • git pull
  • Check current CRAN check results
  • Polish NEWS
  • urlchecker::url_check()
  • devtools::build_readme()
  • devtools::check(remote = TRUE, manual = TRUE)
  • devtools::check_win_devel()
  • revdepcheck::revdep_check(num_workers = 4)
  • Update cran-comments.md
  • git push

Submit to CRAN:

  • usethis::use_version('patch')
  • devtools::submit_cran()
  • Approve email

Wait for CRAN...

  • Accepted 🎉
  • usethis::use_github_release()
  • usethis::use_dev_version(push = TRUE)

Release react 2024.1.0

First release:

Prepare for release:

  • git pull
  • urlchecker::url_check()
  • devtools::build_readme()
  • devtools::check(remote = TRUE, manual = TRUE)
  • devtools::check_win_devel()
  • git push

Submit to CRAN:

  • usethis::use_version('patch')
  • devtools::submit_cran()
  • Approve email

Wait for CRAN...

  • Accepted 🎉
  • usethis::use_github_release()
  • usethis::use_dev_version(push = TRUE)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.