Phoenix.React.Runtime behaviour (Phoenix.React v0.2.0)

View Source

Phoenix.React.Runtime behaviour

Summary

Types

component()

@type component() :: binary()

html()

@type html() :: binary()

path()

@type path() :: binary()

t()

@type t() :: %Phoenix.React.Runtime{
  component_base: path(),
  port: port(),
  render_timeout: integer()
}

Callbacks

config()

@callback config() :: list()

render_to_static_markup(component, map, from, t)

@callback render_to_static_markup(component(), map(), GenServer.from(), t()) ::
  {:reply, {:ok, html()}, t()} | {:reply, {:error, term()}, t()}

render_to_string(component, map, from, t)

@callback render_to_string(component(), map(), GenServer.from(), t()) ::
  {:reply, {:ok, html()}, t()} | {:reply, {:error, term()}, t()}

start(list)

@callback start(component_base: path(), render_timeout: integer()) :: port()