elixir_script v0.14.0 ElixirScript.JS
Summary
Macros
Imports a JavaScript module
Creates new JavaScript objects
Turns an ElixirScript data structure into a JavaScript one
Turns an ElixirScript data structure into JSON
Updates an existing JavaScript object
Macros
Imports a JavaScript module.
Elixir modules can use the normal import
, alias
and require
,
but JavaScript modules work differently and have to be imported
using this.
If module is not a list, then it is treated as a default import, otherwise it is not.
ex: JS.import A, “a” #translates to “import {default as A} from ‘a’”
JS.import [A, B, C], “a” #translates to “import {A, B, C} from ‘a’”