dev_app: Develop an Application

Description Usage Arguments Functions

View source: R/dev-app.R

Description

This is a development utility that is meant to be called interactively to speed up feedback cycles during the development of Apps.

Call dev_app(app_fun) to run the application. During each interval seconds, the application watches the watch directory to see if any source files in the package have changed. If any thing has changed, the package is reloaded, the applicaiton is restarted, and all connected clients are refreshed.

In the global environment, call dev_app_stop() to stop the loop and refreshing, and call dev_app_browse() to open a viewer to the application. dev_app_get() retrieves the current application.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
dev_app(
  app_fun,
  interval = 1L,
  pkg_dir = ".",
  watch = c("R", "inst"),
  browse = FALSE
)

dev_app_stop()

dev_app_browse()

dev_app_get()

Arguments

app_fun

(fun) function to generate an app, must return an App instance.

interval

(num) number of seconds between checks of changes

pkg_dir

(pth) location of the package to be loaded

watch

(dir) director(ies) that is/are monitored for file changes

browse

(flg) whether or not to browse upon startup

Functions


tjpalanca/webtools documentation built on Dec. 23, 2021, 11 a.m.