stimulus: Stimulus

Description Super classes Methods See Also

Description

Stimulus is a JavaScript framework with modest ambitions. Unlike other front-end frameworks, Stimulus is designed to enhance static or server-rendered HTML—the “HTML you already have”—by connecting JavaScript objects to elements on the page using simple annotations.

Documentation

Super classes

webtools::Configurable -> webtools::Plugin -> Stimulus

Methods

Public methods

Inherited methods

Method new()

Create a new TurboPlugin

Usage
Stimulus$new(controllers, app_version)
Arguments
controllers

(chr) paths to controller JS files

app_version

(str) a string that indicates the version


Method router()

Create a Stimulus enabled page

Usage
Stimulus$router(
  path,
  handler,
  ...,
  stimulus = TRUE,
  lang = NULL,
  fragment = FALSE
)
Arguments
path

(str) endpoint

handler

(fun) handler; must have arguments request, response, keys, ... and set the body to html tags

...

(arg) passed to self$router_html()

stimulus

(opt) include stimulus controller assets

  • FALSE - don't include stimulus controllers

  • TRUE - include default stimulus controllers

  • character() - vector of paths to stimulus controller JS files; included along with defaults, include the word "default" to include the default assets

lang

(str) language, defaults to en.

fragment

(flg) is this just a part of a document?


Method assets()

Generates Stimulus Assets

Usage
Stimulus$assets(stimulus = TRUE)
Arguments
stimulus

(opt) include stimulus controller assets

  • FALSE - don't include stimulus controllers

  • TRUE - include default stimulus controllers

  • character() - vector of paths to stimulus controller JS files; included along with defaults, include the word "default" to include the default assets


Method clone()

The objects of this class are cloneable with this method.

Usage
Stimulus$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

See Also

Other Stimulus: ss_use_controller(), stimulus_assets(), stimulus_modifiers


tjpalanca/hotwire.R documentation built on Dec. 23, 2021, 10:59 a.m.