Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Stimulus 2.0-alpha - What's new?

Stimulus 2.0-alpha - What's new?

Light talk about the upcoming features of Stimulus.js.

Matheus Richard

April 02, 2020
Tweet

More Decks by Matheus Richard

Other Decks in Programming

Transcript

  1. Data Map API • A way to pass data to

    a controller. • Use cases: ◦ Storing small strings, such as URLs, dates, or color values; ◦ Bootstrapping a controller with a JSON object or array.
  2. However, the Data Map API only works with string values.

    That means we must manually convert to and from other types as needed
  3. Values API • Makes possible to define values (data maps)

    in the controller itself; • Create properties to accessing them.
  4. Usage The Value object keys are Data Map keys, and

    the values declare their data types
  5. Unifying target attributes Both syntaxes will be supported, but using

    the original syntax will display a deprecation message in the developer console