elixir_script v0.32.1 ElixirScript.JS View Source
This module defines macros and functions which implement JavaScript functionality that may not translate easily to Elixir. For instance, creating a new object
Link to this section Summary
Functions
Creates a breakpoint for JavaScript debuggers to stop at
Determines if value is an instance of type
Takes the given map and returns an object Throws an error if any key is not a number, binary, or atom
Takes the given map and returns an object Throws an error if any key is not a number, binary, or atom
Mutates an existing JavaScript object
Creates new JavaScript objects
Takes the given object and returns a map Options include [{:keys, :atom}, {:recurse_array, true}]
Takes the given object and returns a map Options include [{:keys, :atom}, {:recurse_array, true}]
The current JavaScript context
Throws the term given
Returns the type of the given value
Link to this section Functions
Creates a breakpoint for JavaScript debuggers to stop at
Determines if value is an instance of type.
Takes the given map and returns an object Throws an error if any key is not a number, binary, or atom
ElixirScript.JS.map_to_object(%{my: "map"})
Takes the given map and returns an object Throws an error if any key is not a number, binary, or atom
ElixirScript.JS.map_to_object(%{my: "map"}, keys: :string)
Mutates an existing JavaScript object.
ElixirScript.JS.mutate elem, "width", 100
Creates new JavaScript objects.
ElixirScript.JS.new User, ["first_name", "last_name"]
Takes the given object and returns a map Options include [{:keys, :atom}, {:recurse_array, true}]
ElixirScript.JS.object_to_object({my: "object"})
Takes the given object and returns a map Options include [{:keys, :atom}, {:recurse_array, true}]
ElixirScript.JS.object_to_object({my: "map"}, keys: :atom)
The current JavaScript context
Throws the term given
Returns the type of the given value