R/CurrentSlide.R

Defines functions CurrentSlide

CurrentSlide <- function(maxVal) {
  modules::module({
    val <- 1
    set <- function(x) {
      val <<- max(min(x, maxVal), 1)
      val
    }
    n <- function() set(val + 1)
    p <- function() set(val - 1)
    current <- function() val
    f <- function() set(1)
    l <- function() set(maxVal)
  })
}

Try the REPLesentR package in your browser

Any scripts or data that you put into this service are public.

REPLesentR documentation built on Dec. 1, 2019, 1:19 a.m.