Permalink
Browse files

formatting

  • Loading branch information...
geolessel committed Mar 14, 2018
1 parent 743ac57 commit 6c6cc526e16cd3ffe79c398dab11bee0ed6c9221
Showing with 4 additions and 3 deletions.
  1. +4 −3 lib/react_phoenix/client_side.ex
@@ -25,7 +25,7 @@ defmodule ReactPhoenix.ClientSide do
The resulting `<div>` tag is formatted specifically for the included javascript
helper to then turn into your named React component.
"""
@spec react_component(name :: String.t) :: Phoenix.HTML.safe
@spec react_component(name :: String.t()) :: Phoenix.HTML.safe()
def react_component(name), do: react_component(name, %{})
@doc """
@@ -44,7 +44,7 @@ defmodule ReactPhoenix.ClientSide do
The resulting `<div>` tag is formatted specifically for the included javascript
helper to then turn into your named React component and then pass in the props specified.
"""
@spec react_component(name :: String.t, props :: list | map) :: Phoenix.HTML.safe
@spec react_component(name :: String.t(), props :: list | map) :: Phoenix.HTML.safe()
def react_component(name, props) when is_list(props) do
react_component(name, Enum.into(props, %{}))
end
@@ -77,7 +77,8 @@ defmodule ReactPhoenix.ClientSide do
The resulting `<div>` tag is formatted specifically for the included javascript
helper to then turn into your named React component and then pass in the props specified.
"""
@spec react_component(name :: String.t, props :: map, opts :: [target_id: String.t]) :: Phoenix.HTML.safe
@spec react_component(name :: String.t(), props :: map, opts :: [target_id: String.t()]) ::
Phoenix.HTML.safe()
def react_component(name, props, opts) when is_map(props) do
props = Poison.encode!(props)

0 comments on commit 6c6cc52

Please sign in to comment.