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"})
Link to this function map_to_object(map, options) View Source

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)
Link to this function mutate(object, key, value) View Source

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"})
Link to this function object_to_map(object, options) View Source

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